-->
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: uuid keys
PostPosted: Mon Apr 25, 2005 1:50 pm 
Newbie

Joined: Mon Apr 25, 2005 1:28 pm
Posts: 1
Location: London
Hi all,
We are going to be using Hibernate in a new project and were going to use the UUID generator to create our keys, however I was reading a bit of documentation showing an example:

http://www.hibernate.org/hib_docs/refer ... start.html

Which states:
Quote:
We use the UUID generator (only recommended for testing, as integer surrogate keys generated by the database should be prefered)

Is there any good reason behind this?? It would be nice to know at this early stage in development!

Cheers,
Birju


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 4:24 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
I might think that there would be some sort of performance decrease with using UUIDs, although I've never seen very concrete numbers to say how much of a decrease it would be.

We looked at using UUIDs in order to generate IDs on object creation and then simply use those for our equals() and hashcode() implementations as they would never change. i.e. they'd be set when the object is created and then persisted and retrieved from the DB.

Just never got around to doing it or to doing some concrete testing of our own. Hell, we've still got some composite keys that we wanted to gut from day 1 out of the model that just haven't happened yet either.


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.