Class EntityRepository.EntityUpdater

    • Method Detail

      • update

        public final void update()
        Compare original and updated entities and perform updates. Update the entity version and track changes.
      • entitySpecificUpdate

        public void entitySpecificUpdate()
      • updateVersion

        public final boolean updateVersion​(Double oldVersion)
      • fieldsChanged

        public boolean fieldsChanged()
      • isEntityRestored

        public boolean isEntityRestored()
      • recordChange

        public final <K> boolean recordChange​(String field,
                                              K orig,
                                              K updated)
      • recordChange

        public final <K> boolean recordChange​(String field,
                                              K orig,
                                              K updated,
                                              boolean jsonValue)
      • recordChange

        public final <K> boolean recordChange​(String field,
                                              K orig,
                                              K updated,
                                              boolean jsonValue,
                                              BiPredicate<K,​K> typeMatch)
      • recordChange

        public final <K> boolean recordChange​(String field,
                                              K orig,
                                              K updated,
                                              boolean jsonValue,
                                              BiPredicate<K,​K> typeMatch,
                                              boolean updateVersion)
      • recordListChange

        public final <K> boolean recordListChange​(String field,
                                                  List<K> origList,
                                                  List<K> updatedList,
                                                  List<K> addedItems,
                                                  List<K> deletedItems,
                                                  BiPredicate<K,​K> typeMatch)
      • updateToRelationships

        public final void updateToRelationships​(String field,
                                                String fromEntityType,
                                                UUID fromId,
                                                Relationship relationshipType,
                                                String toEntityType,
                                                List<EntityReference> origToRefs,
                                                List<EntityReference> updatedToRefs,
                                                boolean bidirectional)
        Remove `fromEntityType:fromId` -- `relationType` ---> `toEntityType:origToRefs` Add `fromEntityType:fromId` -- `relationType` ---> `toEntityType:updatedToRefs` and record it as change for entity field `field`.

        When `bidirectional` is set to true, relationship from both side are replaced

      • updateFromRelationships

        public final void updateFromRelationships​(String field,
                                                  String fromEntityType,
                                                  List<EntityReference> originFromRefs,
                                                  List<EntityReference> updatedFromRefs,
                                                  Relationship relationshipType,
                                                  String toEntityType,
                                                  UUID toId)
        Remove `fromEntityType:origFromRefs` -- `relationType` ---> `toEntityType:toId` Add `fromEntityType:updatedFromRefs` -- `relationType` ---> `toEntityType:toId` and record it as change for entity field `field`.
      • storeUpdate

        public final void storeUpdate()
      • updatedByBot

        public final boolean updatedByBot()