-->
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.  [ 4 posts ] 
Author Message
 Post subject: Creating a composite secondary identity column
PostPosted: Thu Jun 24, 2010 7:22 am 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
Hi,

I want to create unique Bill ids that match a certain mask (in my case %year%%countryCode%%sequence%).
So in addition to the default database generated id, I want to fill the billNumber column with the value 2010de00002. 00002 in this case is determined by taking the last billNumber in the database and incrementing by one.

I'm wondering what is the best way to approach this in a transactionally save way?

Kind regards,

Marc


Top
 Profile  
 
 Post subject: Re: Creating a composite secondary identity column
PostPosted: Thu Jun 24, 2010 8:05 pm 
Newbie

Joined: Sun Jun 20, 2010 6:59 pm
Posts: 5
Hey, did you get any way to accomplish this. I have a similar requirement. Please respond if you got this working. Thanks


Top
 Profile  
 
 Post subject: Re: Creating a composite secondary identity column
PostPosted: Tue Jun 29, 2010 8:50 am 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
No, I haven't. Hoping for a reply myself


Top
 Profile  
 
 Post subject: Re: Creating a composite secondary identity column
PostPosted: Tue Jul 06, 2010 6:27 am 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
Anyone? Just looking for an efficient, preferable annotated way to make a custom bill number mask that sequentially increases.
E.g. Countries Netherlands, Brazil
Offer table
billId-Country-billNumber
1-NL-2010NL000001
2-NL-2010NL000002
3-BR-2010BR000001
4-NL-2010NL000003
5-BR-2010BR000002

etc.

Any suggestions are welcome.

Kind regards,

Marc


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