Instance of super-class not found because of joined subclass reference is an inner join

Description

I have the following model:

em.find(Customer.class, id) generates following sql:

The code above works fine, the customer instance is found.

em.find(User.class, id) generates following sql (should return)

The code above does not work (instance of user not found) since Department join is an inner join. This was not the behavior of earlier versions 3.3.x.

See attached code for complete code and tests.

Environment

None

Activity

Show:
Gail Badner
July 10, 2014, 11:05 PM

Does the fix work for you? If not, please open a new Jira for your use case.
Thanks,
Gail

marembo ochieng'
July 10, 2014, 8:43 PM

This issue also affects.

@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class AbstractProfile{}

Gail Badner
July 10, 2014, 5:58 AM

Closing resolved issued in preparation for releasing 4.3.6.

Steve Ebersole
April 8, 2014, 9:39 PM

Technically speaking, the temporary solution will still use inner joins when the entity is a leaf (has no sub-classes). Here, find(Customer.class, id) still generates the inner join because it does not have subclasses.

Steve Ebersole
April 8, 2014, 9:30 PM

See for the better, longer-term solution

Fixed

Assignee

Steve Ebersole

Reporter

Tony Dalbrekt

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major