-->
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: Property Value
PostPosted: Mon Feb 20, 2006 8:37 am 
Newbie

Joined: Wed Nov 23, 2005 7:29 am
Posts: 7
hi

Can anybody tell me how to copy a property value into a column which is not mapped in a class. For example I have two columns and a property in a class, property1 is mapped to column1 and I also need column2 (which is not mapped) having same value that of property1.

Thanks in advance

Rajendra


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 3:09 pm 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
I suggest custom SQL for update/insert :
http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html#querysql-cud

Or triggers ...

Edit : actually custom SQL is not a solution for you since Hibernate won't expect two arguments for a single property. Implementing a UserType will do the trick but it is a bit overengineered IMO. Or use 2 properties A & B and a setter setAB method which duplicates the value.


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.