-->
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: Generated property that is not id column
PostPosted: Mon Sep 05, 2005 5:47 am 
Newbie

Joined: Fri Dec 24, 2004 3:16 am
Posts: 5
Hibernate version:3.0
Name and version of the database you are using:Db2 8.1
Application type: Web application

Hello,

I would like to use an id generator to generate a value for a non-id property of one of my entities.
The entity has an unique id (which is generated using a MultipleHiLoPerTableGenerator) but also a unique number which I would like to generate also using the MultipleHiLoPerTableGenerator.

The reasoning behind this choice is that I am working on an existing database that is being used by multiple client/server delphi apps. Those apps store the id's and unique numbers in one table, so if I create id's and unique numbers I should do the same thing, otherwise those existing apps would run into trouble.

So my question is: is it possible to define a generator that is used by a non-id property, or what would be the best way to use the existing MultipleHiLoPerTableGenerator class to generate that unique number. Should I just create a MultipleHiLoPerTableGenerator myself and set all necessary parameters in the code, or is there a better way?

Thanks for any suggestions

Luc


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 7:38 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you could write your own UserType and let its user type code delegate to a MultimpleHiLoTableGenerator instance.

_________________
Emmanuel


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.