datanucleus-core
datanucleus-core copied to clipboard
CompleteClassTable : support column names for embedded collection element (map key/value, array element)
CompleteClassTable should potentially be able to provide naming for embedded collection elements (where the element is stored nested in something like a JSON/XML object), or embedded map keys/values, etc.
Currently this is not handled completely. We support nested embedded PC fields, and simply store the ColumnImpl
into columns
/columnByName
(keyed by its column name), and its MemberColumnMappingImpl
into mappingByEmbeddedMember
(keyed by its embedded member name PATH). The problems with this are that
- We cannot cope with storing embedded keys AND values this way, since if we have a field
map
then we would just get themappingByEmbeddedMember
path for a fieldfield1
of key asmap.field1
, and if the value had a field of the same name (hencemap.field1
) then how would we know it was for the value? - There is no concept of hierarchy to represent where we are storing the members as "nested", we just have their embedded member path and have to extract it
- We currently have a check whether a column is already used for a "table", and if a nested column name clashes with a column name for a primary field of the main class then we get an exception!
The problem with changing the way these MemberColumnMapping
and Column
objects are stored is that they are accessed from the store plugins for Cassandra, Excel, HBase, JSON, MongoDB, Neo4j, and ODF. Consequently these plugins would need updating to use the "new" API