-->
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: the case for an Embedded Entity .....
PostPosted: Mon Mar 12, 2012 9:43 am 
Newbie

Joined: Mon Mar 12, 2012 7:07 am
Posts: 9
Well I am a newbie and as far as I know I cannot have a class that describes an entity and where instances are used as Embedded data.
Why this specification?
I have precisely the case :
Code:
@Entity
class Data {
   //members
}

@Entity
class DataHistory {
   // information about deprecation
   @Embedded
   private Data deprecatedData ;
}


Here you just cannot use a OnetoOne relationship: deprecated data should not lay in the same table as viable data!
Do I have to copy everything from Data into DataHistory? (I hate the idea ....)
thanks for any suggestion.


Top
 Profile  
 
 Post subject: Re: the case for an Embedded Entity .....
PostPosted: Wed Mar 14, 2012 7:41 am 
Newbie

Joined: Mon Mar 12, 2012 7:07 am
Posts: 9
hack :
Code:
@MappedSuperClass
abstract class AbstractData {
}

@Entity
class Data extends AbstractData{
}

@Embeddable
class ObsoleteData extends AbstractData {
}

if possible! (with all nice details .....)


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.