[hibernate-issues] [Hibernate-JIRA] Created: (METAGEN-77) Inheritance of metamodel classes
Peter Dragula (JIRA)
noreply at atlassian.com
Wed Oct 19 13:40:19 EDT 2011
Inheritance of metamodel classes
---------------------------------
Key: METAGEN-77
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-77
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.1.1.Final
Environment: hibernate 3.6.7, oracle 11g
Reporter: Peter Dragula
Assignee: Hardy Ferentschik
Priority: Minor
If there is Inheritance structure like:
@Entity (No entity annotation) @Entity
public class Party extends public abstract Timelimited extends public abstract Versioned
String name Long timelimitedId Long versionedId
Date date
Long partyId
the model generator generates Party_ with only name date and partyid (no extends )
then it generates Timelimited_ with timelimitedId , but also without any parents (no extends)
and lastly a Versioned_ is generated with versionedId
Now I would like to say Party_.versionedId , but i cant
A workaround is to annotate the Timelimited class (which is in the middle of the hierarchy) with a @Entity
then the Party_ extends Timelimited which extends Versioned and everything works as desired
but JPA allows to have non entity classes in the middle of a hierarchy :
Both abstract and concrete classes can be entities. Both abstract and concrete classes can be annotated with the Entity annotation, mapped as entities, and queried for as entities.
Entities can extend non-entity classes and non-entity classes can extend entity classes:
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list