-->
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.  [ 3 posts ] 
Author Message
 Post subject: Optional persistent associations in a @MappedSuperclass?
PostPosted: Wed Feb 06, 2008 4:52 pm 
Newbie

Joined: Tue Aug 03, 2004 2:54 pm
Posts: 9
Hi all,

Is there any way to have a @MappedSupperclass that has an association (@OneToOne in my case) that is not mapped there, possibly marking it with @Transient, but then optionally mapped as a one-to-one in the child classes extending it? I know that I can use the @AssociationOverride but I only want to do it some of the time, not all of the time.

Thanks!
Nate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 10:08 am 
Beginner
Beginner

Joined: Thu Jun 07, 2007 2:38 am
Posts: 28
Location: Italy, Rome
I am not answering the question directly because I don't know the answer. But it sounds like you trying to solve a missing link in your domain model with Hibernate. Is it possible to go back to your domain model and and this relation/behaviour in a proper way?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 12:18 pm 
Newbie

Joined: Tue Aug 03, 2004 2:54 pm
Posts: 9
erikvaningen wrote:
I am not answering the question directly because I don't know the answer. But it sounds like you trying to solve a missing link in your domain model with Hibernate. Is it possible to go back to your domain model and and this relation/behaviour in a proper way?


Well we are porting from OJB to JPA. OJB only had XML mappings so if you put a mapping on an entity, that extends a common base class of functionality, you got the mapping. If you didn't for another entity, the mapping won't be there. The object being mapped is in the base class so you can see how this is optional relationships... and we did this to give our customers an easy way to extend our product by merely adding an XML mapping to an entity they provide.

It seems like the annotations just are not that flexible.

Thanks for you thoughts though!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.