-->
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: Inherit Anntotations from superclass
PostPosted: Thu Jan 11, 2007 8:10 pm 
Newbie

Joined: Thu Aug 24, 2006 11:10 am
Posts: 16
Hi,
I'm using Hibernate EntityManager and have a problem to used abstract annotated classes which have derived classes.

I've defined an number of abstract classes which have all javax.persistence annotations within. Each abstract class has a derived class which can be extended by user code.

My problem now is that I get an error message "Unknown entity: x.Xxx.class. As it seems the annotations are not inherited to the derived class.

Is there a possibility to inherit annotations of a parent class?


Any help is welcome
Thanks -M


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 12:19 pm 
Newbie

Joined: Thu May 05, 2005 5:54 am
Posts: 17
you don't provide information on how you have annotated the classes you are talking about, so i try to guess.

i have an abstract annotated class with classes extending it.
the only thing i have added in the abstract class to make inheritance work is this:

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
[...]

obviously you can choose another strategy type.


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.