Hibernate version:
2.1.6
Is it possible to relate to objects without using their PK's/FK's in the mapping docs?
i.e.
(in this example, the two tables are related by the email address)
Code:
<class name="Account" table="account">
<id name="id" column="user_id" type="java.lang.String">
<generator class="assigned" />
</id>
<property name="emailAddress" column="email" type="java.lang.String"/>
</class>
<class name="User" table="user">
<id name="id" type="java.lang.Integer" column="user_id" unsaved-value="null">
<generator class="native" />
</id>
<property name="emailAddress" type="java.lang.String" column="email" />
<!-- here's the relation I'd like to achieve -->
<set name="accounts" table="account">
<key column="email"/>
<one-to-many class="Account"/>
</set>
</class>
Is this somehow possible (I know the above mapping won't do it)?
Jon