-->
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: String primary key mapping
PostPosted: Wed Sep 03, 2008 9:27 am 
Newbie

Joined: Wed Sep 03, 2008 9:18 am
Posts: 1
Hi,
I have a table with primary key which is a string.
How should mapping for such id look like?

<id name="name" column="name" type="string">
</id>


Is this enough or the id element should have
<generator class="assigned"/>?
If so what does it mean that id is assigned, hibernate won`t insert id when creating a new object or maybe it won`t insert it to join table fk column and i have to do it my self?


Any help will be appreciated


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 11:10 pm 
Beginner
Beginner

Joined: Wed Apr 20, 2005 9:30 am
Posts: 39
Yes, mapping looks like that, and generator should be assigned - that means it's up to you to assign the primary key BEFORE you save your new object.


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.