NXCALS-166 - Variable Hierarchy
Guys,
despite many changes in this MR there're just a few that, IMO, need your attention, namely:
- service's
Hierarchy
- the hierarchy JPA definition and its many2many relation with variables, - common's
HierarchyData
- the client's hierarchy DTO, - services'
HierarchyPath
- the hierarchy's path definition based on a db view, which uses Oracle's hierarchical query, - V_HIERARCHY_PATHS.sql - the above view definition,
- service's
InternalHierarchyServiceImpl
- contains all logic for hierarchy management (including association with variables), - service's
HierarchyController
- hierarchy API - service's
InternalHierarchyServiceImplTest
- shows what operations (hierarchy modifications) are supported by the API.
A few made assumptions are, IMO, worth mentioning:
-
while querying for a hierarchy, that is by calling
hierarchyController::findWithNodePath("/A/B/C/D/E")
the returned hierarchy DTO will contain all variables associated to all nodes (available viafoundNodeE.getParent().getParent()
etc ...) back to the ROOT node. -
while obtaining Variable DTO from hierarchy (or via
variableService.findBySystemNameAndVariableName("variableName")
) the returned object contain a flat collection of hierarchy paths the given variable belongs to.
This distinction is done due to the fact that one variable may belong to many hierarchies thus if we were to get a proper HierarchyData (that is with all its associated objects - parent(s) and variables) from VariableData we could -
Hierarchy
toHierarchyPath
mapping is uni-directional one2one which has some consequences, one of them being if you were to create a hierarchy and query hierarchyPathRepo for it in the same JPA session you would need to flush, otherwise, since the latter entity is backed by a view, its data is not visible in the session's persistent context.
All, in all it's relatively urgent as this api is needed by the ongoing winccoa ds project so please have a look as soon as reasonably possible.
@acc-logging-team - please have a look for approval.
Closes NXCALS-166