-->
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: How to make embedded object nullable
PostPosted: Tue Nov 27, 2007 12:20 pm 
Newbie

Joined: Tue Nov 27, 2007 12:08 pm
Posts: 1
Is there a way to make an embedded field nullable if the fields of the embeddable object are not nullable?

I have an embeddable object Coordinates which has non-nullable properties latitude and longitude. When referencing Coordinates in the Location class, that reference can be null. Is there a way to clarify this distinction using annotations?

@Embeddable class Coordinates {
private double latitude;
private double longitude;
...
}

@Entity class Location {
@Embedded private Coordinates coordinates; // How can this be made nullable?
...
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 27, 2007 10:33 pm 
Newbie

Joined: Sat Dec 25, 2004 11:18 pm
Posts: 11
Have you tried AttributesOverride ?

Attribute override annotation allows you to override the attribute settings in class where you are using Embeddable class


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.