-->
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: Hibernate problem with update
PostPosted: Fri Mar 27, 2015 3:14 am 
Newbie

Joined: Fri Mar 27, 2015 3:04 am
Posts: 3
I have two tables customer address ,customerOfferpurchase
When customer has no address the id generated for customer address is 0.(means no record in customer address table)

so when we update customerOfferPurchase it internally update customer address as well.

But when it fond no record in customer address it try to store null inside that and causes exception.
If some one has any idea how to avoid updating an entity when it is null inside database .Please share.


Adavance thanks for help.


Top
 Profile  
 
 Post subject: Re: Hibernate problem with update
PostPosted: Fri Mar 27, 2015 8:58 am 
Newbie

Joined: Fri Mar 27, 2015 3:04 am
Posts: 3
Hi ,
I got the solution for my problem .

In customer Offer Purchase Entity
I have put at the top @DynamicUpdate annotation and it works for me.
Now I am able to update customer Offer purchase without changing address id from 0 to null.

Cheers.


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.