JPA OneToOne(optional=true) not supported with @PrimaryKeyJoinColumn

Description

Rejected issue covers this partially. I might have misunderstood, but it seems the reason for rejecting is that @NotFound provides the same capability.

All information I could find for JPA and other ORM tools indicates that this capability is supplied by @OneToOne(optional=true). Hibernate seems to be the lone ORM tool that requires the use of a proprietary annotation: @NotFound.

@NotFound works, but the problem is that it makes the application no longer be pure-JPA. Not supporting pure-JPA outer joins would seem to be a major bug.

Environment

Hibernate 3.3.1, annotations 3.4.0, MsSQL DB.

Activity

Show:
Gail Badner
August 23, 2011, 11:55 PM

I've confirmed that optional=true works as expected when the associated entities do not share the same ID.

Gail Badner
August 31, 2011, 9:29 PM

This will have to wait until we have a response about how @NotFound functionality relates to the spec with respect to an optional one-to-one on a primary key.

Gail Badner
October 11, 2011, 11:48 PM

optional=true was broken by the fix for HHH-5109.

For now, I'll back out of the fix for HHH-5109. A new fix for that does not break optional=true will be covered by HHH-6723.

Gail Badner
October 12, 2011, 1:01 PM
Edited

Backed out of in master and 3.6.

Brett Meyer
March 7, 2014, 10:07 PM

Bulk closing tickets resolved in released versions

Assignee

Gail Badner

Reporter

Bruno Melloni

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure