<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

    <class name="org.biojavax.SimpleCrossRef" table="dbxref" node="crossref" entity-name="CrossRef">

        <id name="id" type="integer" unsaved-value="null" column="dbxref_id" node="@id">
            <generator class="sequence">
                <param name="sequence">dbxref_pk_seq</param>
            </generator>
        </id>

        <property name="dbname" node="@db"/>
        <property name="accession" node="@accession"/>
        <property name="version" node="@version"/>
        <set name="noteSet" table="dbxref_qualifier_value" lazy="false" sort="natural">
            <key column="dbxref_id" not-null="true"/>
            <composite-element class="org.biojavax.SimpleNote" node="note">
                <many-to-one name="term" class="Term" column="term_id" not-null="true" cascade="persist,merge,save-update" node="@termId" embed-xml="false"/>
                <property name="value"/>
                <property name="rank" node="@rank"/>
            </composite-element>
        </set>        
        
    </class>

</hibernate-mapping>