-->
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: mapping property to sequence
PostPosted: Fri Mar 11, 2005 12:51 pm 
Newbie

Joined: Fri Mar 11, 2005 12:40 pm
Posts: 1
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version: 3.0

Hi,

I already have a id field (primary key) mapped to sequence, and there is another property need to map to another sequence in oracle, how can I do that?

The "WarrantNum" is not a primary key, but it needs to map to an oracle sequence.

I can't put the <generator> inside <property> tag, what's my option?

<property name="WarrantNum" type="long">
<column name="WARRANT_NUM" length="22" not-null="true" sql-type="NUMBER" />
</property>

Thanks.
David


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 1:09 pm 
Beginner
Beginner

Joined: Mon Nov 29, 2004 5:34 pm
Posts: 35
Ok, I myself did not try myself. but from what i read, i can tell you that, in your mapping file change those two to composite key and give the sequence to both of them and try this option.

Please let us know the results.

srigold


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 12:02 pm 
Newbie

Joined: Mon Mar 14, 2005 11:54 am
Posts: 6
Hi

I would be interested to know how you solved this issue since I am facing the same issue of mapping a non primary key (or part of composite key) i.e. a property to a sequence in Oracle. The sequence is there to preserve an order for enrties made.

One way to do it would be to make a Usertype for that property...

/Georges


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.