Dear all,
I've two tables: Project and ProjectVersion; a Project can have many Versions and this relationship works like a charm with one-to-many relationship provided by Hibernate:
Code:
<set name="versions" lazy="true" inverse="true">
<key column="project_id"/>
<one-to-many class="dao.ProjectVersion"/>
</set>
Of all the versions for a given project one and only one would be marked as "default" version. That is, version table has an additional flag called is_default.
My question is how would I map this default version such that Project.getDefaultVersion() returns me an instance of ProjectVersion class representing the default version.
Thanks in advance for your help.
ATTA