That's our understanding. When we run a test that calls the get method on Session to return a POJO, the associations are returned. Apparently lazy loading is a common topic of discussion so maybe there's a misunderstanding on our part. I included the mapping file that's returning the associations. Maybe we are missing something.
Grant
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">
<!-- Generated Jun 20, 2006 2:48:02 PM by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
<class name="gov.seahawk.portal.services.persistence.model.Vessel" table="Vessel" schema="dbo" catalog="SeaHawk_Repository">
<id name="vesselId" type="string">
<column name="vesselId" length="36" />
<generator class="guid"></generator>
</id>
<many-to-one name="sourceIMONumber" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceIMONumber" length="36" />
</many-to-one>
<many-to-one name="sourceFlag" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceFlag" length="36" />
</many-to-one>
<many-to-one name="sourceUSCGNumber" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceUSCGNumber" length="36" />
</many-to-one>
<many-to-one name="sourceName" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceName" length="36" />
</many-to-one>
<many-to-one name="sourceVesselType" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceVesselType" length="36" />
</many-to-one>
<many-to-one name="sourceAge" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceAge" length="36" />
</many-to-one>
<many-to-one name="sourceRadioCallSign" class="gov.seahawk.portal.services.persistence.model.DataSource" fetch="select">
<column name="sourceRadioCallSign" length="36" />
</many-to-one>
<property name="imoNumber" type="string">
<column name="imoNumber" length="7" />
</property>
<property name="uscgNumber" type="string">
<column name="uscgNumber" length="50" />
</property>
<property name="age" type="string">
<column name="age" length="10" />
</property>
<property name="flag" type="string">
<column name="flag" length="36" />
</property>
<property name="name" type="string">
<column name="name" length="100" />
</property>
<property name="radioCallSign" type="string">
<column name="radioCallSign" length="30" />
</property>
<property name="vesselType" type="string">
<column name="vesselType" length="5" />
</property>
<property name="mdTimeStamp" type="timestamp">
<column name="mdTimeStamp" length="23" />
</property>
<property name="mdLastUpdateId" type="string">
<column name="mdLastUpdateId" length="20" />
</property>
<set name="vesselAgents" inverse="true">
<key>
<column name="vesselId" length="36" not-null="true" />
</key>
<one-to-many class="gov.seahawk.portal.services.persistence.model.VesselAgent" />
</set>
<set name="vesselOperators" inverse="true">
<key>
<column name="vesselId" length="36" not-null="true" />
</key>
<one-to-many class="gov.seahawk.portal.services.persistence.model.VesselOperator" />
</set>
<set name="vesselArrivals" inverse="true">
<key>
<column name="vesselId" length="36" not-null="true" />
</key>
<one-to-many class="gov.seahawk.portal.services.persistence.model.VesselArrival" />
</set>
<set name="vesselRisks" inverse="true">
<key>
<column name="vesselId" length="36" not-null="true" />
</key>
<one-to-many class="gov.seahawk.portal.services.persistence.model.VesselRisk" />
</set>
</class>
</hibernate-mapping>