Mapping gets confused if superclasses are in different packages.

Description

Let's say because you use a mixture of generated and customized code, so that most of your classes are split into a generated superclass in one package, and a subclass that's where you put custom code. If you put the generated code in a different package, Hibernate will have issues with the mapping, such that it will miss the superclasses. This becomes obvious if you generate the metamodel, because it will omit "extends superclass" from the model.

i.e.:

com.example.jpa.generated
com.example.jpa.custom

public class com.example.jpa.custom.RootClass.java

public class com.example.jpa.generated.FirstClassGen.java extends RootClass

public class com.example.jpa.custom.FirstClass.java extends FirstClassGen

public class com.example.jpa.generated.SecondClassGen.java extends FirstClass

public class com.example.jpa.custom.SecondClass.java extends SecondGlassGen

This causes Hibernate to get confused. However, if everything is in the same package, things are ok, the superclasses are correctly mapped.

Environment

None

Activity

Show:
Pierce Wetter
August 5, 2010, 6:46 PM

I came in to downgrade this, because there's an easy workaround. Don't see any way to edit it though?

Anyways, the problem only happens with the MetaModel stuff when you're using pure annotations. If you add an orm.xml that lists all the entities and mapped superclasses, it goes away.

https://forum.hibernate.org/viewtopic.php?f=1&t=1006239

Gail Badner
August 5, 2010, 6:59 PM

Thanks, Pierce. I've downgraded to Minor.

Brett Meyer
April 7, 2014, 5:41 PM

In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.

If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.

Thank you!

Brett Meyer
July 8, 2014, 3:11 PM

Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!

Rejected

Assignee

Unassigned

Reporter

Pierce Wetter

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor