-->
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: Pre-populate database when using uuid.hex generator
PostPosted: Mon Apr 19, 2004 4:14 pm 
Newbie

Joined: Thu Apr 08, 2004 3:45 pm
Posts: 5
Location: Boulder, Colorado, USA
Hi,

I'm using Hibernate 2.1 in my Tomcat/Struts webapp. The user can
create a record in the database. I use the uuid.hex generator (in anticipation of wanting to make it cluster-safe). Someone wants me
to populate the database with the contents of a spreadsheet. That's not using my app, so the primary key isn't going to be generated as uuid.hex.

Is that a problem? I mean, the primary key doesn't need to be uuid.hex when the app is running and reading the database, right? Just when using the app to create a new record.

Thanks for your wisdom,
==Leonard


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 19, 2004 4:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This is not a problem. You could however easily access the uuid.hex algorithm from your javacode to populate the DB to produce "similar" identifiers. This is not absolutely necessary, you should however always make sure you don't use ids to prepopulate the DB that will later on be generated by uuid.hex


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 19, 2004 4:24 pm 
Newbie

Joined: Thu Apr 08, 2004 3:45 pm
Posts: 5
Location: Boulder, Colorado, USA
Thank you for your rapid response.

I was planning to put together a simple SQL script that would insert
the data into the table. I wouldn't be using Java for this part of it.

Since the uuid.hex IDs are 32 characters long, couldn't I create just
about anything that doesn't have 32 characters and be safe from a collision with IDs generated by Hibernate?

Sorry to ask what may be painfully simple questions. :-)

_________________
==Leonard


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 19, 2004 4:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Shorter IDs should be safe.


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.