-->
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: @Embedded Objects are set to null when loading.
PostPosted: Tue Dec 05, 2006 1:59 pm 
Newbie

Joined: Fri Oct 14, 2005 5:47 pm
Posts: 6
I've got the following field:
@Embedded
private Address address = new Address();

If I create an object, but don't fill in any fields on address, when I restore it, address will be null (instead of having an Address object with all null properties). Is there a way to keep address from being set to null?

If it would just leave it alone, the default would take care of it, but it is being explicitly set null.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 06, 2006 12:09 pm 
Newbie

Joined: Fri Oct 14, 2005 5:47 pm
Posts: 6
Scratch that: Taking the default is a bad idea. But, it seems a bit arbitrary to replace the object with null just because its fields are null. Is there are way to change this arbitrary behavior to do what I want instead? i.e. create the object, but set the fields to null.


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.