NullPointerException querying against inherited properties of a MappedSuperclass.

Description

I have created an Embeddable class that serves as a table key that extends an already defined MappedSuperclass which results in a composite-key for the table.

BaseId.java

MyEntityId.java

Now using the JPA Criteria API shown below, the code throws a NullPointerException when attempting to find the records:

TestCase.java

After fiddling with this, I have determined that if the BaseId class is associated to another class designated as an Entity, then the NullPointerException isn't thrown an the above query works. However, if the BaseId isn't associated to any entity and merely serves as a common class across a series of derived classes, Hibernate will throw the following error:

Environment

Hibernate 4.3.5 Final

Assignee

Unassigned

Reporter

Chris Cranford

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure