Skip to content

Tighten the contract of PersistentPropertyPath regarding nullability #2813

Closed
@odrotbohm

Description

@odrotbohm

We should change the definition of PersistentPropertyPath to — in its public API — not allow empty instances anymore. Those violate the concept and bleed into the concept's API by having to make all methods nullable (returning null in exactly that "empty" case). An empty property path doesn't make any actual sense as you cannot reasonably answer the methods declared on the interface except by returning null, which then causes client code having to verify the returned values all the time.

This is now changed into only making PersistentPropertyPath.getParentPath() nullable and letting it return null for single segment paths. Adapted client code accordingly. ….getRequiredLeadProperty() is now deprecated in favour of ….getLeafProperty() not returning null anymore.

Metadata

Metadata

Assignees

Labels

in: mappingMapping and conversion infrastructure

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions