| AbstractPropertyMapping#hasNonIdentifierPropertyNamedId} is incorrectly returning {{false when the associated entity ID is named id (as in the attached test). Fixing AbstractPropertyMapping#hasNonIdentifierPropertyNamedId makes the test pass, but, the resulting query does not do a join with the associated entity table, which is incorrect for an optional one-to-one association. Also, without fixing AbstractPropertyMapping#hasNonIdentifierPropertyNamedId, the generated SQL for the query "from Foo f where f.bar.id = :barId" properly has a join to the associated entity table. After fixing AbstractPropertyMapping#hasNonIdentifierPropertyNamedId, the query does not have the join. Interestingly, changing Bar#id to #id1 (or to anything other than id), the join no longer appears in the generated SQL for "from Foo f where f.bar.id = :barId", which is also a bug. If/when this is fixed, we need to make sure that it does not cause a regression for JPA/HQL queries. |