Add more tests and improve fix for HHH-12592

Description

Lazy properties in embeddables/composites are not currently supported for embeddables due HHH-10480.

The fix for will call the owning entity BytecodeEnhancementMetadata#isAttributeLoaded for a collection contained within an embeddable, using a property name that is qualified by the embeddable (e.g., grouping.things). The method simply returns false in this case, because there is no lazy property with this (qualified) name.

Depending on how is fixed, Hibernate may need to be changed to call BytecodeEnhancementMetadata#isAttributeLoaded for the embeddable (not the entity) with an unqualified property name.

I made a small change to the fix for so that Hibernate does not bother calling BytecodeEnhancementMetadata#isAttributeLoaded if the collection is in an embeddable.
I will also mention this code needs to be revisited when is fixed.

I also added a couple of tests involving lazy collections in embeddables that shows that things work properly currently, before is fixed.

Environment

None

Status

Assignee

Gail Badner

Reporter

Gail Badner

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major