-->
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.  [ 2 posts ] 
Author Message
 Post subject: problem assigning a FK
PostPosted: Tue Aug 19, 2008 5:32 pm 
Newbie

Joined: Thu Aug 14, 2008 4:26 pm
Posts: 7
I get this below error during FK assignment...

Foreign key (FK7C93E25F6DCEB433:APP.UTILIZEDPARTICIPANTOPPORTUNITY [TARGETED_TIMESTAMP])) must have same number of columns as the referenced primary key (APP.TARGETEDPARTICIPANTOPPORTUNITY [OPPORTUNITY_ID,BENEFICIARY_ID,TARGETED_TIMESTAMP])

Below are the hbm files for APP.TARGETEDPARTICIPANTOPPORTUNITY
and APP.UTILIZEDPARTICIPANTOPPORTUNITY ...

Please suggest if my assignment is wrong ...

APP.TARGETEDPARTICIPANTOPPORTUNITY

<composite-id >
<key-property name="opportunityID" column="OPPORTUNITY_ID" > </key-property>
<key-property name="beneficiaryID" column="BENEFICIARY_ID"></key-property>
<key-property name="targetedTimestamp" column="TARGETED_TIMESTAMP"></key-property>
</composite-id>
<property name="targetedTimestamp" column="TARGETED_TIMESTAMP" type="timestamp" insert="false" update="false"/>
<property name="beneficiaryID" column="BENEFICIARY_ID" insert="false" update="false" />
<property name="opportunityID" column="OPPORTUNITY_ID" insert="false" update="false" />
<set name="targetedTimestamp" >
<key column="TARGETED_TIMESTAMP" />
<one-to-many class="opportunity.UtilizedParticipantOpportunityObj" />
</set>

APP.UTILIZEDPARTICIPANTOPPORTUNITY


<composite-id >
<key-property name="opportunityID" column="OPPORTUNITY_ID" > </key-property>
<key-property name="beneficiaryID" column="BENEFICIARY_ID"></key-property>
<key-property name="targetedTimestamp" column="TARGETED_TIMESTAMP"></key-property>
<key-property name="callingTimestamp" column="CALLING_TIMESTAMP"></key-property>
</composite-id>
<property name="beneficiaryID" column="BENEFICIARY_ID" insert="false" update="false" />
<property name="opportunityID" column="OPPORTUNITY_ID" insert="false" update="false" />
<property name="targetedTimestamp" column="TARGETED_TIMESTAMP" type="timestamp" insert="false" update="false"/>
<property name="callingTimestamp" column="CALLING_TIMESTAMP" type="timestamp" insert="false" update="false"/>


Top
 Profile  
 
 Post subject: Any suggestions ?????????
PostPosted: Wed Aug 20, 2008 5:22 pm 
Newbie

Joined: Thu Aug 14, 2008 4:26 pm
Posts: 7
I tried this way ...

TARGETEDPARTICIPANTOPPORTUNITY .hbm.xml

<class name="opportunity.TargetedParticipantOpportunityObj" table="APP.TARGETEDPARTICIPANTOPPORTUNITY">
<composite-id >
<key-property name="opportunityID" column="OPPORTUNITY_ID" > </key-property>
<key-property name="beneficiaryID" column="BENEFICIARY_ID"></key-property>
<key-property name="targetedTimestamp" column="TARGETED_TIMESTAMP" type="timestamp" ></key-property>
</composite-id>

and

UTILIZEDPARTICIPANTOPPORTUNITY.hbm.xml
class name="opportunity.UtilizedParticipantOpportunityObj" table="APP.UTILIZEDPARTICIPANTOPPORTUNITY">
<composite-id >
<key-property name="callingTimestamp" column="CALLING_TIMESTAMP"></key-property>
<key-many-to-one name="targetedTimestamp_UP" class="opportunity.TargetedParticipantOpportunityObj" >
<column name="OPPORTUNITY_ID" />
<column name="BENEFICIARY_ID"/>
<column name="TARGETED_TIMESTAMP" />
</key-many-to-one>
</composite-id>
<property name="channelID" column="CHNL_ID"/>
<property name="presentationID" column="PRESENTATION_ID" />
<property name="createUserID" column="CREATE_USER_ID" />
<property name="closedOpportunityCommentText" column="CLOSEDOPPCOMMENTTEXT" />
<property name="firstLevelDispositionCode" column="FIRST_LEVEL_DISP_CODE" />
<property name="secondLevelDispositionCode" column="SECOND_LEVEL_DISP_CODE" />
</class>


but it throws me below error ..

Could not execute JDBC batch update
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at opportunity.TestHibernate.main(TestHibernate.java:65)
Caused by: org.apache.derby.client.am.BatchUpdateException: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
at org.apache.derby.client.am.Agent.endBatchedReadChain(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatchX(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.executeBatch(Unknown Source)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 8 more



Any suggestions ?????????


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

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.