NHibernate elt Field

Does anyone know why NHibernate generates a field called "elt" of type int to display many, many? I wonder why I need it. Thanks

+7
sql-server-2005 nhibernate
source share
3 answers

The elt field is the foreign key for an element in many mappings. In the join table, you should see two columns of the foreign key, id (for the parent) and elt (for the element). You can use different names if you want; these are the default values.

+11
source share

Thank you, yes, you're right to play a little, I found that if I did not explicitly specify a default column for elt.

<bag name="equipment" table="tb_room_equipment" lazy="false"> <key column="roomID"/> <many-to-many class="Equipment" column="equipmentID"/> </bag> 

Like here, I now called columnID; If I do not, it will be called elt.

+4
source share

More recently, it turned out that the elt field was created if you used the keyword e.g. User or Role . > when using code matching. This is just an observation, I have not tried using `(backtick) for forced quotes

+2
source share

All Articles