-->
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.  [ 1 post ] 
Author Message
 Post subject: generating guid dynamically
PostPosted: Fri Jan 14, 2011 5:19 am 
Newbie

Joined: Wed Jan 05, 2011 1:12 pm
Posts: 3
Hi,

I want to generate a guid for a non primary key field. Is it possible? i am using reverse engineering from Hibernate tools. Inorder to do it do i need to modify my mapping file and entity classes.

My Entity class:

public String getGuid() {
return this.guid;
}

public void setGuid(String guid) {
this.guid = guid;
}

My mapping:

<property generated="never" lazy="false" name="guid" type="string">
<column length="36" name="Guid" not-null="true"/>
</property>



Could I use a generator class here to generate it automatically even if it is not a primary key column?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.