-->
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: Can I force @Embedded property to always have a value?
PostPosted: Thu Apr 09, 2009 7:29 am 
Newbie

Joined: Wed Oct 25, 2006 8:45 am
Posts: 9
I have the following property in an entity:

Code:
    @Embedded
    private Location location = new Location();


Unfortunately, if every property within this embedded class is null, Hibernate will also set the location variable itself to null, rather than leave location as is and set its own properties to null.

Is there any way to override this default behaviour? Currently I have to add a @PostLoad method to each entity that has embedded properties.


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.