-->
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.  [ 3 posts ] 
Author Message
 Post subject: composite-id with one column autonumber
PostPosted: Tue Feb 01, 2005 10:23 am 
Newbie

Joined: Tue Feb 01, 2005 10:09 am
Posts: 2
I have a table with a composite id :

<composite-id
name="comp_id_PROJECT_VERSIONS"
class="PROJECT_VERSIONSPK">
<!-- bi-directional many-to-one association to PROJECTS -->
<key-many-to-one
name="PROJECTS"
class="PROJECTS">
<column name="PROJECT_ID" />
</key-many-to-one>
<key-property
name="PROJECT_VERSION_ID"
column="PROJECT_VERSION_ID"
type="java.lang.Integer"
length="18"/>
</key-property>
</composite-id>

i want the column PROJECT_VERSION_ID to take automaticaly value from an oracle sequence. So i think i need to place the below directive :

<generator class="sequence">
<param name="sequence">SEQ_PROJECT_VERSIONS_PK</param>
</generator>

somewhere but i do not know where.
Can you give me a hint? Should I use id or collection-id instead of composite-id?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 10:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
auto-generation with composite ids is not possible.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 11:04 am 
Newbie

Joined: Tue Feb 01, 2005 10:09 am
Posts: 2
Thank you for your quick answer


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.