-->
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: How to Handle Composite Key
PostPosted: Tue Apr 17, 2012 4:48 am 
Newbie

Joined: Sat Jan 23, 2010 4:38 am
Posts: 5
Hi,

I have USER table where user_id is identity and auto generated i.e. increment by 1 for each new record.
I have a TRANSACTION table where each user_id will have its transaction_id.

I plan to configure transaction_id as auto increment for each user for example

user_id 1 make a new transaction first time, transaction_id value should be 1
for another transaction from the same user should generate transaction_id value as 2 and so on...

But in between if user_id 2 make a new transaction first time, transaction_id value should be 1 and so on.

That is for each user, it should be different sequence to auto generate.

Can you please suggest how to handle it using Hibernate?

Many thanks,


Top
 Profile  
 
 Post subject: Re: How to Handle Composite Key
PostPosted: Tue Apr 17, 2012 6:46 am 
Newbie

Joined: Sat Jan 23, 2010 4:38 am
Posts: 5
Hi,

Anyone can help to handle such requirement?

Many Thanks,


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.