-->
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: Hibernate null updates
PostPosted: Thu Aug 20, 2009 12:12 pm 
Newbie

Joined: Thu Aug 20, 2009 12:00 pm
Posts: 2
How do I configure Hibernate not to overwrite values in DB with the null attributes?


Top
 Profile  
 
 Post subject: Re: Hibernate null updates
PostPosted: Fri Aug 21, 2009 12:51 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Can you not just set the property to null in the entity?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Hibernate null updates
PostPosted: Sat Aug 22, 2009 3:17 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
>>
Can you not just set the property to null in the entity?

Ok, you're saying you have null properties in the entity, but there is real data in the database? How are you loading the entity? The entity should be loaded from the database, right? So, my questions then would be 'why are the properties in the entity null, if they have real values in the database?'

Where are these annoying nulls coming from?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Hibernate null updates
PostPosted: Sat Aug 22, 2009 9:28 pm 
Newbie

Joined: Thu Aug 20, 2009 12:00 pm
Posts: 2
It's an enterprise platform where persistent objects are exposed to the web tier via the EJB. There is a possibilty where the new instance of the persistent object is created and passed back to the middle tier. In that case, some values in DB can get wiped out.


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.