-->
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.  [ 5 posts ] 
Author Message
 Post subject: Mapping my own "id" (primary key) which is defined
PostPosted: Sun May 16, 2004 1:21 pm 
Beginner
Beginner

Joined: Tue May 11, 2004 10:21 am
Posts: 20
I am defining my own id (primary key) for the database table using the system time as a varchar(11). How do I may this as an id?

Please, any example would be helpful

TIA

Tom K.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 1:22 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There are several ways to do that, but I don't think its a good idea. Why can't you use a simple number sequence?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Re: Mapping my own "id" (primary key) which is def
PostPosted: Sun May 16, 2004 1:38 pm 
Beginner
Beginner

Joined: Tue May 11, 2004 10:21 am
Posts: 20
I am (trying to) migrating my project over to Hibernate and need to preserve the installed base (which is working fine). I suppose I will take your advice, but at this time I would like to query with the keys I have in place.
Is this possible to do, with an I to migrate it to a Hibernate generated key?

TIA

Tom K.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Sure, have a look at IdentifierGenerator and the rest of the documentation, which is very extensive about that topic.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 2:05 pm 
Beginner
Beginner

Joined: Tue May 11, 2004 10:21 am
Posts: 20
Thanks Christian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.