Interface EntitySnapshotDataStore

All Known Implementing Classes:
EntitySnapshotDataStoreImpl

public interface EntitySnapshotDataStore
Interface defining methods for creating and getting operations on entity snapshots.

Implementation of this interface defined method and location entity snapshots storage. The default behavior is to save entity snapshots as JPA entities in one table. If you want to redefinition default behavior you must create your own implementation of the interface.

  • Method Details

    • findEntitySnapshotByMetaClassAndEntity

      List<EntitySnapshotModel> findEntitySnapshotByMetaClassAndEntity(Object entity, MetaClass entityMetaClass)
      Loads list of snapshots specific entity.
      Parameters:
      entityMetaClass - MetaClass object, defining the type of snapshots
      entity - Object object, defining entity id what will be used for load snapshots
      Returns:
      list of snapshots, or an empty list if not found
    • findLastSnapshot

      @Nullable EntitySnapshotModel findLastSnapshot(Object entity, MetaClass entityMetaClass)
      Loads last snapshot of specific entity.
      Parameters:
      entityMetaClass - MetaClass object, defining the type of the snapshot
      entity - Object object, defining entity id what will be used for load snapshot
      Returns:
      load snapshot, or null if not found
    • findLastSnapshotById

      @Nullable EntitySnapshotModel findLastSnapshotById(Object referenceId, MetaClass entityMetaClass)
      Loads last snapshot of specific entity.
      Parameters:
      entityMetaClass - MetaClass object, defining the type of the snapshot
      referenceId - Object object, defining entity id what will be used for load snapshot
      Returns:
      load snapshot, or null if not found
    • saveSnapshot

      void saveSnapshot(Collection<EntitySnapshotModel> entitySnapshots)
      Save collection of entity snapshots.
      Parameters:
      entitySnapshots - EntitySnapshotModel snapshots for saving
    • save

      EntitySnapshotModel save(EntitySnapshotModel entitySnapshotModel)
      Save entity snapshot.
      Parameters:
      entitySnapshotModel - EntitySnapshotModel snapshot for saving
      Returns:
      saved instance