|
In terms of normalizing the paths, specific use-cases include:
-
Attribute of basic type on entity
-
Attribute of composite type on entity
-
Attribute of basic type on composite
-
Attribute of composite type on a composite
-
Collection with element of basic type
-
Collection with element of composite type
-
Collection (map) with key of basic type
-
Collection (map) with key of composite type
I don't think the spec allows for the case of composite with a collection-valued attribute; verify this.
Ultimately the idea is to normalize all these cases down to a tuple of <Source,Path> and map that to the appropriate AttributeConverter accounting for proper override rules. Then the problem boils down to properly discovering the Source and Path as part of the normalization. Generally speaking, that leaves us with:
-
Attribute of basic type on entity
-
Source = the entity
-
Path = the attribute name
-
Attribute of composite type on entity
-
Source = the entity
-
Path = the attribute name
-
Attribute of basic type on composite
-
Source = <the composite source> + <composite property name>
-
Path = the attribute name
-
Attribute of composite type on a composite
-
Source = <the composite source> + <composite property name>
-
Path = the attribute name
-
Collection with element of basic type
-
Source = the collection
-
Path = "" for non-maps, "value" for maps
-
Collection with element of composite type
-
Source = the collection
-
Path = "" for non-maps, "value" for maps
-
Collection (map) with key of basic type
-
Source = the collection
-
Path = "key"
-
Collection (map) with key of composite type
-
Source = the collection
-
Path = "key"
Additionally, converters can only be applied to basic types which removes any of the points above with composite type (although the composite types need to be known/handled for the purpose of nested composite paths). So ultimately, the Source can be:
-
An entity (basic attributes)
-
A composite of an entity (nested composites)
-
A collection (basic elements or basic map keys)
-
A composite collection element, potentially nested (collection with composite elements)
-
A composite map key, potentially nest (map with composite key)
|