-->
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: Can my joined-subclass have its own primary key?
PostPosted: Thu Feb 24, 2005 5:08 pm 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
Hibernate version: 2.1.8

Mapping documents:


<hibernate-mapping>
<class name="com.notiva.cbo.buyer.data.setup.types.MemoLineReasonSetupImpl" lazy="true" table="MEMO_LINE_REASON_SETUP" >

<id column="MEMO_LINE_REASON_ID" name="id" type="java.lang.Long" unsaved-value="null">
<generator class="com.notiva.util.hibernate.SequenceIntervalGenerator">
<param name="sequence">SEQ_MEMO_LINE_REASON_SETUP_ID</param>
<param name="interval">50</param>
</generator>
</id>
<version column="VERSION_NBR" name="version" type="integer"/>
<property column="CODE" length="5" name="code" type="java.lang.String"/>
<property column="SHORT_DESC" length="40" name="shortDescription" type="java.lang.String"/>

<joined-subclass name="com.notiva.cbo.buyer.data.setup.types.VarianceDetailReasonSetupImpl" lazy="true"
table="VARIANCE_DETAIL_REASON_SETUP">

<key column="MEMO_LINE_REASON_ID" />

<property column="VARIANCE_TYPE_ID" name="varianceType" not-null="true" type="com.notiva.core.data.lookup.VarianceType"/>

</joined-subclass>

</class>

</hibernate-mapping>

Name and version of the database you are using: Oracle 9i


Here's my problem, my table: VARIANCE_DETAIL_REASON_SETUP needs to have its own PK because of a long story. I cannot figure out how to do this, is it possible?

I need to add something like this to the <joined-subclass mapping:


<id column="VARIANCE_DETAIL_REASON_ID" name="myId" type="java.lang.Long" unsaved-value="null">
</id>


..but then it wouldn't quite be a subclass then would it? Hmm... anyone have any design suggestions?

Thanks,

Matt Dowell
Notiva Corp.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 24, 2005 9:27 pm 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
I found someone with the same problem.

http://forum.hibernate.org/viewtopic.ph ... edsubclass

We are going to manually manage the PK on the joined-subclass.

Matt


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.