-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problem with Composite-id
PostPosted: Tue Apr 13, 2004 1:29 pm 
Beginner
Beginner

Joined: Thu Feb 05, 2004 9:09 am
Posts: 27
I use Oracle 9i and I have this problem.

TABLE PEOPLE
COLUMNS:

CD_PEOPLE (PK) - value genereted by sequence oracle
DT_NASC (PK)
NM_PEOPLE

How can I use composite-id and mapping genereted called sequence.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 3:34 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
http://forum.hibernate.org/viewtopic.php?t=927648


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 4:46 pm 
Beginner
Beginner

Joined: Thu Feb 05, 2004 9:09 am
Posts: 27
Thank you for your help, but I talk about SEQUENCE ON ORACLE, there are little diference between auto-increment and sequence.
We talk about Oracle remember.

Regard


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 4:57 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
Quote:
We talk about Oracle remember.


Zippy.

Maybe you need to subclass SequenceGenerator or implement your own IdentifierGenerator.

Can't help you there. Don't know Oracle from Adam. Good luck.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 5:12 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
CD_PEOPLE (PK) - value genereted by sequence oracle
DT_NASC (PK)

it's not because your oracle primary key is composite that your pojo must define exactly the same composite id.
You surely have a good reason why your composite primary key is defined like this but for me it has no sense in the "object world", the only field CD_PEOPLE allows you to define correctly the object unicity as it is a sequence.

So just define CD_people as the id of your pojo and let dt_nasc as a not null property.


Anthony[/code]


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