Regarding the query, here's the issue. Usually, for an embeddable component, if all of the properties are null, we return null instead of the component itself. It's more correct for:
Entity#component == null
instead of
Entity#component#prop1 == null Entity#component#prop2 == null ...
Your test case has a User entity with an @ElementCollection of Map<Profile, ContactInfo>, where Profile is an @Entity and ContactInfo is @Embeddable. So, the map value is null if the ContactInfo props are all null. I'm not sure if it makes sense to change that. Steve Ebersole, any thoughts?
|