-->
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: saving partial entity
PostPosted: Thu Feb 10, 2011 1:25 am 
Newbie

Joined: Thu Feb 10, 2011 1:19 am
Posts: 2
How can we save partial entities using hibernate ?

For example :
I have a table with columns viz: Id, Name, Address, Contact.
I want to overwrite only Name and Address, and NOT the Contact column.


Top
 Profile  
 
 Post subject: Re: saving partial entity
PostPosted: Thu Feb 10, 2011 4:41 am 
Regular
Regular

Joined: Fri Nov 12, 2010 4:13 am
Posts: 81
Location: India
Hi mohitsen,

Quote:
How can we save partial entities using hibernate ?


If you are using hbm file then try this out,

<property name="Contact" column="Contact" update="false" type="java.lang.String"/>

Here update="false" will not allow Contact column to be overwrite.


Thanks,
Chirag

_________________
Thanks & Regards,
Chirag


Top
 Profile  
 
 Post subject: Re: saving partial entity
PostPosted: Thu Feb 10, 2011 5:02 am 
Newbie

Joined: Thu Feb 10, 2011 1:19 am
Posts: 2
Quote:
Here update="false" will not allow Contact column to be overwrite.


Hey Chirag,
I forgot to mention, this decision to escape over-writing a particular column will be made on run-time.
So, how on run-time i can achieve so ?


Top
 Profile  
 
 Post subject: Re: saving partial entity
PostPosted: Thu Feb 10, 2011 5:27 am 
Regular
Regular

Joined: Fri Nov 12, 2010 4:13 am
Posts: 81
Location: India
Hi mohitsen,

Quote:
I forgot to mention, this decision to escape over-writing a particular column will be made on run-time.
So, how on run-time i can achieve so ?


I haven't worked on it yet.But this article can help you in some way.

http://www.geekarticles.com/article/Support-of-Custom-Fields-with-Hibernate.html


Thanks,
Chirag

_________________
Thanks & Regards,
Chirag


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.