biguniverse wrote:
Thanks. By the way, if you have a sample XML file that shows "parent/child plus lots of refereces mapped with many-to-one", that would be awesome :-)
Thanks again.
You are welcome
It is a simplified mapping:
Code:
<?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 package="model.data">
<class name="Customer" table="CUSTOMER">
<id name="customerId" column="CUSTOMER_ID"
type="java.lang.Integer">
<generator class="native" />
</id>
<property name="firstName" column="FIRST_NAME" type="java.lang.String" />
<property name="lastName" column="LAST_NAME" type="java.lang.String" />
<property name="middleName" column="MIDDLE_NAME" type="java.lang.String" />
<many-to-one name="nameSuffix" column="NM_SFX_SCODE_ID" class="model.Systemcode" />
<many-to-one name="namePrefix" column="NM_PFX_SCODE_ID" class="model.Systemcode" />
<many-to-one name="maritalStatus" column="MRTL_STS_SCODE_ID" class="model.Systemcode" />
<many-to-one name="language" column="LANGUAGE_ID" class="model.Language" />
<many-to-one name="customerStatus" column="STATUS_CODE_ID" class="model.Systemcode" />
<set name="phones" lazy="true"
cascade="all-delete-orphan" inverse="true">
<key column="CUSTOMER_ID" />
<one-to-many class="Phone" />
</set>
<set name="addresses" lazy="true"
cascade="all-delete-orphan" inverse="true">
<key column="CUSTOMER_ID" />
<one-to-many class="Address" />
</set>
</class>
</hibernate-mapping>
All many-to-one to referencial classes are unidirectional