For some reason when I retrieve an NcContact record,
the orgUnitIdAndorgUnitType is always null rather than
having an NcOrgUnit assigned to it. The log shows that the
values for the column is being retrieved properly but for some
reason Hibernate is hiding the values from me.
Any ideas?
George
Hibernate version:
3.1
Mapping documents:
Generated by hibernate-tools 3.1 beta 3
<hibernate-mapping>
<class name="ca.ubc.nmc.contacts.db.NcContact" table="NC_CONTACT">
<id name="contactId" type="long">
<column name="CONTACT_ID" precision="10" scale="0" />
<generator class="ca.ubc.nmc.contacts.ContactIdGenerator"></generator>
</id>
<many-to-one name="role" class="ca.ubc.nmc.contacts.db.NcRoleTypeTbl" fetch="select">
<column name="ROLE" length="4" />
</many-to-one>
<many-to-one name="orgUnitIdAndorgUnitType" class="ca.ubc.nmc.contacts.db.NcOrgUnit" fetch="select">
<column name="ORG_UNIT_ID" length="10" />
<column name="ORG_UNIT_TYPE" length="4" />
</many-to-one>
<many-to-one name="classificationCde" class="ca.ubc.nmc.contacts.db.NcClassifTypeTbl" fetch="select">
<column name="CLASSIFICATION_CDE" length="4" not-null="true" />
</many-to-one>
<many-to-one name="lastUpdtBy" class="ca.ubc.nmc.contacts.db.NcContact" fetch="select">
<column name="LAST_UPDT_BY" precision="10" scale="0" not-null="true" />
</many-to-one>
<property name="nameLast" type="string">
<column name="NAME_LAST" length="40" not-null="true" />
</property>
[
Name and version of the database you are using:
Oracle9
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
...
[org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [ca.ubc.nmc.contacts.db.NcContact#1371]
[org.hibernate.type.StringType] - returning 'STAF' as column: ROLE1_0_
[org.hibernate.type.StringType] - returning 'UBC' as column: ORG3_1_0_
[org.hibernate.type.StringType] - returning null as column: ORG4_1_0_
[org.hibernate.type.StringType] - returning 'BCNT' as column: CLASSIFI5_1_0_
...
[org.hibernate.loader.Loader] - done processing result set (1 rows)
[org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
[org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[org.hibernate.jdbc.AbstractBatcher] - closing statement
[org.hibernate.loader.Loader] - total objects hydrated: 1
[org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [ca.ubc.nmc.contacts.db.NcRoleTypeTbl#STAF]
[org.hibernate.event.def.DefaultLoadEventListener] - creating new proxy for entity
[org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [ca.ubc.nmc.contacts.db.NcClassifTypeTbl#BCNT]
[org.hibernate.event.def.DefaultLoadEventListener] - creating new proxy for entity
[org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [ca.ubc.nmc.contacts.db.NcContact#86]
[org.hibernate.event.def.DefaultLoadEventListener] - creating new proxy for entity
...
|