2

Both entity A & B's id are:

CompositeId().KeyProperty(x => x.Id).KeyProperty(x => x.Type);

While entity B should Reference entity A (it has a property "A" of type A). I tried:

References(x => x.A).Columns("AId", "Type");

Which gave me IndexOutOfRange exception when trying to insert, the reason was that the "Type" property was mapped twice. So I added:

References(x => x.A).Columns("AId", "Type").Not.Update().Not.Insert();

Which causes AId to always be NULL because it's defined not to be inserted. I want it to be insertable and updatable, while "Type" not to be. How can I do this?

Adam Tal
  • 5,911
  • 4
  • 29
  • 49
  • i have the same problem but havent found a solution yet: http://stackoverflow.com/q/6047926/671619 – Firo Feb 14 '12 at 12:03
  • `Which causes AId to always be NULL because it's defined not to be inserted. I want it to be insertable and updatable, while "Type" not to be. How can I do this?` Can you not insert/update this entity separately? – Cole W Feb 14 '12 at 20:51
  • What do you mean insert the entity separately? You want me to make a different insert query to the DB that updates the column AId? – Adam Tal Feb 16 '12 at 20:33

0 Answers0