The recent work on exposing Ag metadata (#459) highlighted a number of shortcomings of the current entity metadata model in regards to ID handling, such as leaking of DB column names in IDs (#463).
And here is another one - logically from the Agrest perspective an ID can be comprised from a combination of attributes and relationships, but currently we can represent it only as a set of attributes. This spills over to things like ID handling in EntityUpdate, etc.
This task is an attempt to straighten the ID model of AgEntity:
Introduce a superinterface of AgAttribute and AgRelationship - AgProperty
Model ID as a Set<AgProperty>
ID attributes and relationships should be present in the corresponding property collections (currently attributes returned from AgEntity.getIds() are NOT present in AgEntity.getAttributes())
The hope is that this would allow to fix the inconsistencies per #463, ID representation in EntityUpdate, etc. and generally present a consistent universal ID model not tied to the database structure.
Upgrade Notes
Now @AgId can be combined with @AgAttribute or @AgRelationship over the same method. Standalone @AgId is resolved as @AgAttribute (this is backwards compatible).
The recent work on exposing Ag metadata (#459) highlighted a number of shortcomings of the current entity metadata model in regards to ID handling, such as leaking of DB column names in IDs (#463).
And here is another one - logically from the Agrest perspective an ID can be comprised from a combination of attributes and relationships, but currently we can represent it only as a set of attributes. This spills over to things like ID handling in
EntityUpdate
, etc.This task is an attempt to straighten the ID model of AgEntity:
Set<AgProperty>
AgEntity.getIds()
are NOT present inAgEntity.getAttributes()
)The hope is that this would allow to fix the inconsistencies per #463, ID representation in EntityUpdate, etc. and generally present a consistent universal ID model not tied to the database structure.
Upgrade Notes
@AgId
can be combined with@AgAttribute
or@AgRelationship
over the same method. Standalone@AgId
is resolved as@AgAttribute
(this is backwards compatible).