Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2
Mapping documents:
<?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 Aug 7, 2008 1:40:24 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="gov.faa.infra.oets.model.ObstEvalCase" table="OBST_EVAL_CASE" lazy="false">
<id name="obstEvalCaseUuid" type="string" >
<column name="OBST_EVAL_CASE_UUID" />
<generator class="assigned" />
</id>
<property name="caseTypeCd" type="string">
<column name="CASE_TYPE_CD" length="10" />
</property>
<property name="aeronauticalStudyNbr" type="string">
<column name="AERONAUTICAL_STUDY_NBR" length="25" />
</property>
<property name="evalPriorityCd" type="string">
<column name="EVAL_PRIORITY_CD" length="10" />
</property>
<property name="nearestArptId" type="string">
<column name="NEAREST_ARPT_ID" length="4" />
</property>
<property name="cntyCd" type="string">
<column name="CNTY_CD" length="10" />
</property>
<property name="stCd" type="string">
<column name="ST_CD" length="2" />
</property>
<property name="estDueDt" type="date">
<column name="EST_DUE_DT" length="7" />
</property>
<property name="durDesc" type="string">
<column name="DUR_DESC" />
</property>
<property name="durDaysQty" type="big_decimal">
<column name="DUR_DAYS_QTY" precision="9" />
</property>
<property name="durMonthsQty" type="big_decimal">
<column name="DUR_MONTHS_QTY" precision="9" />
</property>
<property name="priorAeronauticalStudyNbr" type="string">
<column name="PRIOR_AERONAUTICAL_STUDY_NBR" length="25" />
</property>
<property name="projectId" type="string">
<column name="PROJECT_ID" length="25" />
</property>
<property name="svcAreaId" type="string">
<column name="SVC_AREA_ID" length="25" />
</property>
<property name="stSbdvsnCd" type="string">
<column name="ST_SBDVSN_CD" length="10" />
</property>
<property name="oeaaaBeginDt" type="date">
<column name="OEAAA_BEGIN_DT" length="7" />
</property>
<property name="createdUserId" type="string">
<column name="CREATED_USER_ID" length="40" not-null="true" />
</property>
<property name="createdDttm" type="timestamp">
<column name="CREATED_DTTM" length="11" not-null="true" />
</property>
<property name="lastUpdatedUserId" type="string">
<column name="LAST_UPDATED_USER_ID" length="40" not-null="true" />
</property>
<property name="lastUpdatedDttm" type="timestamp">
<column name="LAST_UPDATED_DTTM" length="11" not-null="true" />
</property>
<set name="obstEvalCaseStats" inverse="true" lazy="false" outer-join="true">
<key>
<column name="OBST_EVAL_CASE_UUID" not-null="true" />
</key>
<one-to-many class="gov.faa.infra.oets.model.ObstEvalCaseStat" />
</set>
<set name="obstEvalCaseAsgnmts" inverse="true" lazy="false" outer-join="true">
<key>
<column name="OBST_EVAL_CASE_UUID" not-null="true" />
</key>
<one-to-many class="gov.faa.infra.oets.model.ObstEvalCaseAsgnmt" />
</set>
</class>
</hibernate-mapping>
The problem is as follows :
When I try to retrieve data using load(class,id) where is id is of type String. It is mapped to a field which is of type RAW(16) oracle. It does not load the data.
Also I am using data source (Spring version 2.5)
<jee:jndi-lookup jndi-name="jdbc/oetsds" id="oetsDataSource"/>
jdbc/oetsds : create in the OC4j 10.1.3.3 application server.
But if I define the datasource in applicationContext, that is not using jndi lookup I am able to load the data. Example
<bean id="refSessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" >
<bean class="oracle.jdbc.pool.OracleDataSource">
<property name="URL" value=""/>
<property name="user" value=""/>
<property name="password" value=""/>
</bean>
</property>
<property name="mappingResources">
<list>
<value>ObstEvalPrsnl.hbm.xml</value>
......
Can somebody tell me as to why is this not working ? It happens only if the Primary key is of type RAW(16) in Oracle and when I doing the datasource lookup using JNDI using spring.
Only exception is data not found. There is data in the table. Please help