-->
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: id, generator
PostPosted: Sat Feb 21, 2004 5:39 pm 
Newbie

Joined: Wed Aug 27, 2003 5:35 am
Posts: 5
Hi, i have an object wich ID is generated with an increment generator (see the snipet) :
<class name="dataClasses.RelCommand" table="commande">
<id name="Id" column="id" type="long">
<generator class="increment"/>
</id>
[...]


... and I just want to know if it is possible that to have random ID instead of increment ID ?

thx a lot, and sorry if the question had already been posted ...

++


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2004 7:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Not with a builtin solution. I really think this is a crapy idea, how would you guarantee that a randomly generated id is unique? Why do you want that anyways, if the id is meaningless for you, you can as well use increment.

If you have any real reasons for doing that, you could still implement your own generator - but I would strongly advise you against that.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2004 3:01 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
uuid.hex, uuid.string generators are 'almost' unique

_________________
Emmanuel


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.