Code:
<hibernate-mapping schema="informix" package="mytest">
<class name="mytest.SchemeItem" table="scheme" optimistic-lock="none">
<id name="id" type="integer" unsaved-value="null" column="id">
<generator class="native"/>
</id>
<property name="numberItem" type="integer" column="number_item" not-null="true"/>
<property name="text" type="string" column="text" length="255" not-null="true"/>
<property name="levelNumber" type="integer" column="level_number" not-null="true"/>
<property name="parrentCode" type="integer" column="parrent_code"/>
<property name="indChild" type="integer" column="ind_child" not-null="true"/>
<properties name="aa21" update="true" insert="true" >
<property name="code" type="string" column="code" not-null="true"/>
<property name="idVersion" type="integer" column="id_version" not-null="true" update="false" insert="false"/>
</properties>
<bag name="measureUnits">
<key property-ref="aa21">
<column name="code"/>
<column name="id_scheme"/>
</key>
<one-to-many class="SchemeItemUnits"/>
</bag>
</class>
and
Code:
<class name="SchemeItemUnits" table="scheme_units" optimistic-lock="none">
<id name="id" type="integer" unsaved-value="null">
<column name="id" not-null="true" unique="true" index="191_382"/>
<generator class="native"/>
</id>
<property name="code" type="string" column="code" length="50" not-null="true"/>
<property name="type" type="short" column="type" not-null="true"/>
<property name="unit" type="string" column="unit" length="50" not-null="true"/>
<property name="idScheme" type="integer" column="id_scheme" not-null="true"/>
</class>