Sorry, my bad, it was the other side of the relation that created the column (Person, HasMany). And I found the overload to set ColumnName on the KeyReference...
Funny that, you scratch your head for hours and as soon as you ask some, the answer is obvious... /Peter From: Peter Hageus [mailto:peter.hag...@gmail.com] Sent: den 13 oktober 2009 08:18 To: fluent-nhibernate@googlegroups.com Subject: CompositeId and ColumnNames Hi. If I've interpreted the issue right, there isn't a way to set columnname om composite id's. However. I'm having an issue with this that I'm sure someone has a workaround for: The mapping: CompositeId() .KeyReference(a => a.Person) .KeyReference(a => a.AddressType); Map(a => a.AddressLine1); Map(a => a.AddressLine2); Map(a => a.ZipCode); Map(a => a.City); Map(a => a.Country); Creates this SQL: create table [Address] ( Person INT not null, AddressType INT not null, AddressLine1 NVARCHAR(255) not null, AddressLine2 NVARCHAR(255) not null, ZipCode NVARCHAR(255) not null, City NVARCHAR(255) not null, Country NVARCHAR(255) not null, PersonId INT null, primary key (Person, AddressType) ) Where does the nullable PersonId come from? (I add ForeignKey.EndsWith("Id") in the mapping, but without it I get Person_id) I tried adding this: References(a => a.Person).Column("Person"); to make them use the same column, but no difference. I even have a IReferenceConvention not allowing any nullable fk's, so I don't understand where the nullable PersonId comes from at all! Thankful for any help! /Peter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---