Is it possible to have a collection whose foreign key references a column which is not a primary key but just a unique column?
Code:
<class name="Index" table="index_names">
<id name="Id" column="id">
<generator class="assigned"/>
</id>
<property name="Name" column="name" length="36" unique-key="true"/>
<bag name="Values" inverse="true" table="index_values" order-by="date asc">
<key column="name"/>
<composite-element class="IndexValue">
<property name="Date" column="date"/>
<property name="Value" column="value"/>
</composite-element>
</bag>
</class>
Note
<key column="name"/>.
Is this supported in NHibernate?
If no, is there a workaround?