> On Feb. 27, 2017, 5:27 p.m., David Radley wrote: > > I have done a little testing at V2 to model a parent children hierarchy > > that we would need to define a Glossary (see Jira 1410) > > > > I define types EntityA with a children 1 to many optional attribute to > > EntityB. EntityB has a mantidory pointer to an EntityA parent. > > > > EntityA type has > > "name": "children", > > "typeName": "array<EntityB>", > > "cardinality": "SINGLE", > > "constraintDefs": [ > > { > > "type": "ownedRef" > > } > > ], > > ], > > "isIndexable": false, > > "isOptional": true, > > "isUnique": false > > }, > > EntityB type has attributes like this: > > "name": "parent", > > "typeName": "EntityA", > > "cardinality": "SINGLE", > > "constraintDefs": [ > > { > > "type": "inverseRef", > > "params": { > > "attribute": "children" > > } > > } > > ], > > "isIndexable": false, > > "isOptional": false, > > "isUnique": false > > > > I then define > > -an instance of EntityA > > -an instance of EntityB with parent pointing to EntityA (I have to supply > > the parent attribute as it is isOptional false). > > > > If I then get (using the API) the EntityA instance it does not have any > > content in its children. Is this expected? It seems that if I am allowed to > > do this then the children and parent pointers are out of sync. > > > > Am I missing something? > > David Kantor wrote: > I added a test case that mimics your use case and could not reproduce the > issue - when I get the EntityA instance its children attribute contains the > EntityB instance, indicating the inverse reference was updated correctly. > Perhaps you were running without my changes? I will follow up with you.
There was a mistake in my test case - but the API accepted the request - which led to the unexpected behaviour. I have raised ATLAS-1609 to police API content, and to error on unrecognised (e.g. misspelt) request content. The fix looks good. Ship it. - David ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56860/#review166897 ----------------------------------------------------------- On Feb. 24, 2017, 3 p.m., David Kantor wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/56860/ > ----------------------------------------------------------- > > (Updated Feb. 24, 2017, 3 p.m.) > > > Review request for atlas. > > > Bugs: ATLAS-1552 > https://issues.apache.org/jira/browse/ATLAS-1552 > > > Repository: atlas > > > Description > ------- > > Automatic update of inverse references in V2 (V1?) code path. > > > Diffs > ----- > > intg/src/main/java/org/apache/atlas/type/AtlasStructType.java > 57ad1063eb0d225102a2b8b72232054f57b9c36b > intg/src/test/java/org/apache/atlas/TestUtilsV2.java > 84e17cb364fbf6d07b2211d85e336d8146fdb684 > intg/src/test/java/org/apache/atlas/type/TestAtlasEntityType.java > 2d71d4135025339cd072982efa1231575bf21035 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java > 3f87e695b01a21f0cbd453f6de68269c5fe025aa > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java > f1efe46404d71187c2691f9b795916ed6c26ef3e > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java > 09f69dbe6f519d84ae8e223532fc5adaa411ed9b > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasDeleteHandlerV1Test.java > 555f0acc22c4bec67f1a2a4064acad66e939747a > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateHardDeleteV1Test.java > PRE-CREATION > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateSoftDeleteV1Test.java > PRE-CREATION > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateV1Test.java > PRE-CREATION > > > Diff: https://reviews.apache.org/r/56860/diff/3/ > > > Testing > ------- > > Ran all unit and integration tests with no regressions. > > > Thanks, > > David Kantor > >