[fluent-nhib] Re: Many to Many Mapping with extra data in the link table:

2009-09-21 Thread Dani
Hi, The PK for enlisted is composed of groupid and member Id. I can add a Indentity surrogate key (although It is completely useless - but for NH sake...) I though that I can map the group class with has-many to the enlistedmember class. and map the enlistedmember class with has-one to the member

[fluent-nhib] Re: problem deleting from a many-to-many relation

2009-09-21 Thread John Leger
Check your cascade operations ... Are you cascading all? Be careful with cascades ... they can cause this type of behavior. HTH, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post

[fluent-nhib] Set constraint name on foreign key through conventions

2009-09-21 Thread bondehagen
How can I set the constraint name on foreign keys using conventions? I know it is possible on the mapping, like: mapping.HasMany(x => x.Children).ForeignKeyConstraintName ("FK_Something") But I want to do something like: public class HasManyConvention : IHasManyConvention { #regi

[fluent-nhib] Re: Many to Many Mapping with extra data in the link table:

2009-09-21 Thread queen3
You problem with EnlistedMebmer table is that you don't have PK - which is generally highly not recommended. Can't you just add autoincremented PK there and here you go? Another issue is that you don't want your EnlistedMebmer to be an entity. However, as pointed many times by others (in "NHibern

[fluent-nhib] Re: How To Combine Fluent Mapping And Conventions

2009-09-21 Thread Mark Phillips
Mikael, After tinkering with Conventions for a while, I'm convinced to use Fluent over XML Configuration. Thanks for your time. Mark On Sep 21, 11:15 am, Mikael Henriksson wrote: > Almost correct you should use:  * > .Conventions.AddFromAssemblyOf()* > > On Mon, Sep 21, 2009 at 5:09 PM, Ma

[fluent-nhib] problem deleting from a many-to-many relation

2009-09-21 Thread mhnyborg
I have as problem with NH. When I remove a product from FirstExample.Store (Id==1) NH is doing this: DELETE FROM StoreProduct WHERE Store_id = 1 INSERT INTO StoreProduct (Store_id, Product_id) VALUES (1 ,2) INSERT INTO StoreProduct (Store_id, Product_id) VALUES (1 ,3) INSERT INTO StoreProduc

[fluent-nhib] How To Combine Fluent Mapping And Conventions

2009-09-21 Thread Mark Phillips
Hi, I am trying to combine FluentMapping with Conventions. Most of the documentation combines AutoMapping and Conventions. http://aleris.wordpress.com/2009/03/28/combining-explicit-mappings-and-conventions-in-fluent-nhibernate/ describes an approach, but it no longer matches the API. ISessi

[fluent-nhib] Problem deleting from a many-to-many relation

2009-09-21 Thread mhnyborg
I have as problem with NH. When I remove a product from FirstExample.Store (Id==1) NH is doing this: DELETE FROM StoreProduct WHERE Store_id = 1 /* @p0 */ INSERT INTO StoreProduct (Store_id, Product_id) VALUES (1 /* @p0 */,2 /* @p1 */) INSERT INTO StoreProduct

[fluent-nhib] Re: How To Combine Fluent Mapping And Conventions

2009-09-21 Thread Mikael Henriksson
Almost correct you should use: * .Conventions.AddFromAssemblyOf()* On Mon, Sep 21, 2009 at 5:09 PM, Mark Phillips wrote: > > Hi, > > I am trying to combine FluentMapping with Conventions. Most of the > documentation combines AutoMapping and Conventions. > > > http://aleris.wordpress.com/2009/03

[fluent-nhib] Re: Self-Referencing many to many issue

2009-09-21 Thread Kasper22
Hey All, Well I got a little rest this weekend and dug at the problem a little more today. It looks like the problem is that if you have more than one self-referencing relationship in the same table things get messed up. All I ended up needing to do was add a check to see if the tables the rela

[fluent-nhib] Re: Default Of Null In Generated Db Table Fields?

2009-09-21 Thread Mark Phillips
Eric, Thanks for the reply. I looked on the web for instructions on how to combine fluent mappings with conventions and the instructions don't match the API. For example I got this from http://aleris.wordpress.com/2009/03/28/combining-explicit-mappings-and-conventions-in-fluent-nhibernate/ : I

[fluent-nhib] Many to Many Mapping with extra data in the link table:

2009-09-21 Thread Dani
Hi, I've posted this question in several places with no concrete answer: I'm trying to map a many to many relation with data in the link table: I'm using the FNH 1.0 RTM. this is my db: tblGroups: GroupID GroupName tblMembersInGroup: GroupID MemberID Rank tblMembers: MemberID, Name this is my