I'm trying some mappings. And I wanted to know if anybody good give me a hint if I'm on the right way.
Can I right to classes for the same table? or should I drop one?
Code:
<hibernate-mapping package="ch.globus.nglr">
<class name="NglrRemark" table="NGLR_REMARK">
<composite-id>
<key-many-to-one
class="ch.globus.nglr.NglrHeader"
column="HEADERID"
length="10"
name="headerid"
not-null="true"
type="java.lang.Integer"
/>
<key-property
column="REMARKTYPE"
length="1"
name="remarktype"
not-null="true"
type="java.lang.String"
/>
</composite-id>
<list
inverse="true"
name="Remarklines"
table="NGLR_REMARK"
>
<index column="SEQNBR" type="java.lang.Integer" />
<one-to-many class="ch.globus.nglr.NglrRemarkLine" />
</list>
</class>
<class name="NglrRemarkLine" table="NGLR_REMARK">
<composite-id>
<key-many-to-one
class="ch.globus.nglr.NglrHeader"
column="HEADERID"
name="header"
/>
<key-many-to-one
class="ch.globus.nglr.NglrRemark"
column="REMARKTYPE"
name="remarktype"
/>
<key-property
column="SEQNBR"
length="10"
name="seqnbr"
not-null="true"
type="java.lang.Integer"
/>
</composite-id>
<property
column="TEXT"
length="72"
name="text"
not-null="true"
type="java.lang.String"
/>
</class>
</hibernate-mapping>