-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Joined Subclass
PostPosted: Tue Mar 29, 2005 10:34 pm 
Newbie

Joined: Tue Mar 29, 2005 10:20 pm
Posts: 1
Hi :

I seem to be having an error creating a joined sub class. Below is the mapping - I get a java.lang.ClassCastException exception ....

When I look at the logs it looks like it is not setting the id at the sub class level.

However in my code I explicitly set the id.

Is there anything in the mapping I may be missing...

[b]Hibernate version:2.**[/b]

[b]Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "=//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.gs.aml.ctf.dataobject.CaseDataObject" table="CASE_STATE_TB" >
<meta attribute="class-description">
Table CASE_STATE_TB.
</meta>
<id name="id" column="CASE_ID_I" type="int" >
<generator class="assigned">
</generator>
</id>
<property name="caseTypeId" type="int" column="CASE_TYPE_I" not-null="true" />
<property name="caseStatusId" type="int" column="CASE_STATUS_I" not-null="true" />
<property name="caseCreateDt" type="timestamp" column="CREATE_DT" not-null="false"/>
<property name="caseAssigneeId" type="int" column="ASSIGNEE_I" not-null="true" />
<property name="caseOwnerGroupId" type="int" column="OWNER_GRP_I" not-null="true" />
<property name="caseChgById" type="int" column="CHG_BY_I" not-null="true" />
<property name="caseChgOnDt" type="timestamp" column="CHG_ON_DT" not-null="true" />

[color=red][b]<joined-subclass name="com.gs.aml.specialfocus.dataobject.SFEntityCaseDataObject" table="SF_ENTITY_CASE_DATA_TB" >
<key column="CASE_ID_I" />
<property name="entityId" type="int" column="ENTITY_ID_I" not-null="true" />
<property name="commnNameTxt" type="string" column="CMMNNAMETXT_C" not-null="true" />
<property name="reasonCodeId" type="int" column="REASON_CODE_I" not-null="false"/>
<property name="requestorId" type="int" column="REQUESTOR_ID_I" not-null="false" />
<property name="fileNumber" type="string" column="FILE_NUMBER_C" not-null="false" />
<property name="pepFlag" type="string" column="PEP_FLAG_C" not-null="false" />
<property name="controlledEntityFlag" type="string" column="CONTROLLED_ENTITY_FLAG_C" not-null="false" />
<property name="controlledEntityReason" type="string" column="CONTROLLED_FLAG_REASON_C" not-null="false" />
<property name="dataQuality" type="string" column="DATA_QUALITY_C" not-null="false" />
<property name="sfStatus" type="string" column="SF_STATUS_C" not-null="false" />
<property name="createDt" type="timestamp" column="CREATE_DT" not-null="false" />
<property name="endDt" type="timestamp" column="END_DT" not-null="false" />
<property name="createById" type="int" column="CREATE_BY_I" not-null="false" />
<property name="chgById" type="int" column="CHG_BY_I" not-null="false" />
<property name="chgOnDt" type="int" column="CHG_ON_DT" not-null="false" />
</joined-subclass>[/b][/color]
</class>
</hibernate-mapping>
[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:

Tue Mar 29 21:21:39 EST 2005 DEBUG [main] about to open: 0 open PreparedStatements, 0 open ResultSets
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] insert into SFDEV.CASE_STATE_TB (CASE_TYPE_I, CASE_STATUS_I, CREATE_DT, ASSIGNEE_I, OWNER_GRP_I, CHG_BY_I, CHG_ON_DT, CASE_ID_I) values (?, ?, ?, ?, ?, ?, ?, ?)
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] preparing statement
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] about to open: 1 open PreparedStatements, 0 open ResultSets
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] insert into SFDEV.SF_ENTITY_CASE_DATA_TB (ENTITY_ID_I, CMMNNAMETXT_C, REASON_CODE_I, REQUESTOR_ID_I, FILE_NUMBER_C, PEP_FLAG_C, CONTROLLED_ENTITY_FLAG_C, CONTROLLED_FLAG_REASON_C, DATA_QUALITY_C, SF_STATUS_C, CREATE_DT, END_DT, CREATE_BY_I, CHG_BY_I, CHG_ON_DT, CASE_ID_I) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] preparing statement
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] Dehydrating entity: [com.gs.aml.specialfocus.dataobject.SFEntityCaseDataObject#99]
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 1
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 2
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '29 March 2005 21:21:39' to parameter: 3
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 4
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 5
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 6
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '29 March 2005 21:21:39' to parameter: 7
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '99' to parameter: 8
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '12343' to parameter: 1
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding 'NEW TEST' to parameter: 2
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 3
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 4
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '111' to parameter: 5
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding 'T' to parameter: 6
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding 'T' to parameter: 7
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding 'NEW REASON' to parameter: 8
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding 'T' to parameter: 9
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding 'A' to parameter: 10
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding null to parameter: 11
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '29 March 2005 21:21:39' to parameter: 12
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding null to parameter: 13
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '1' to parameter: 14
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] binding '2005-03-29 21:21:39.579' to parameter: 15
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] done closing: 1 open PreparedStatements, 0 open ResultSets
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] closing statement
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] done closing: 0 open PreparedStatements, 0 open ResultSets
java.lang.ClassCastException
Tue Mar 29 21:21:39 EST 2005 DEBUG [main] closing statement
at net.sf.hibernate.type.IntegerType.set(IntegerType.java:31)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.persister.NormalizedEntityPersister.dehydrate(NormalizedEntityPersister.java:377)
at net.sf.hibernate.persister.NormalizedEntityPersister.dehydrate(NormalizedEntityPersister.java:360)
at net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:459)
at net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:433)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2360)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at com.gs.aml.framework.db.AMLHibernatePersistanceManager.hibernateFinishTran(AMLHibernatePersistanceManager.java:547)
at com.gs.aml.framework.db.AMLHibernatePersistanceManager.endTran(AMLHibernatePersistanceManager.java:136)
at com.gs.aml.framework.db.AMLHibernatePersistanceManager.performDataBeansListTransaction(AMLHibernatePersistanceManager.java:196)
at com.gs.aml.specialfocus.dataobject.action.SFCaseTaskDataObjectAction.insertBeans(SFCaseTaskDataObjectAction.java:90)
at com.gs.aml.specialfocus.tests.SFTest.main(SFTest.java:52)

[/b]

[b]Name and version of the database you are using:
UDB
[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.