code: private void registerRefEntityIndexActions(Entity entity) {
      // bidirectional attribute: register indexing actions for other side
      getEntityType()
          .getMappedByAttributes()
          .forEach(
              mappedByAttr -> {
                EntityType mappedByAttrRefEntity = mappedByAttr.getRefEntity();
                entity
                    .getEntities(mappedByAttr.getName())
                    .forEach(
                        refEntity ->
                            indexActionRegisterService.register(
                                mappedByAttrRefEntity, refEntity.getIdValue()));
              });
  
      getEntityType()
          .getInversedByAttributes()
          .forEach(
              inversedByAttr -> {
                Entity refEntity = entity.getEntity(inversedByAttr.getName());
                if (refEntity != null) {
                  EntityType inversedByAttrRefEntity = inversedByAttr.getRefEntity();
                  indexActionRegisterService.register(
                      inversedByAttrRefEntity, refEntity.getIdValue());
                }
              });
    }
docs: Register index actions for the given entity for entity types with bidirectional attribute
  values.
  
  @param entity entity to add or delete