-->
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: Best practices question
PostPosted: Mon Sep 01, 2003 5:13 am 
Newbie

Joined: Mon Sep 01, 2003 5:10 am
Posts: 7
Location: Freiburg, Germany
Hi,

Not really Hibernate related I guess, but what are the advantages/disadvantages of using uuid.hex over a sequence as an hibernate id?

TIA,

John


Top
 Profile  
 
 Post subject: Re: Best practices question
PostPosted: Sat Sep 06, 2003 8:48 am 
psynix wrote:
Hi,

Not really Hibernate related I guess, but what are the advantages/disadvantages of using uuid.hex over a sequence as an hibernate id?

TIA,

John


Hi John,

"uuid.hex" uses an algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.

where as, if you have a sequence created in your database is being used as the key-value for a class-property, you use sequence.

Both are unique. In certain cases requirements are such like you /have/ to use sequence, use generator class="sequence", if you just want to generate a unique number and you don't have any constraint to use sequence, use "uuid.hex".

Raj


Top
  
 
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.