Package io.jmix.audit.snapshot.datastore
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 Summary
Modifier and TypeMethodDescriptionfindEntitySnapshotByMetaClassAndEntity
(Object entity, MetaClass entityMetaClass) Loads list of snapshots specific entity.findLastSnapshot
(Object entity, MetaClass entityMetaClass) Loads last snapshot of specific entity.findLastSnapshotById
(Object referenceId, MetaClass entityMetaClass) Loads last snapshot of specific entity.save
(EntitySnapshotModel entitySnapshotModel) Save entity snapshot.void
saveSnapshot
(Collection<EntitySnapshotModel> entitySnapshots) Save collection of entity snapshots.
-
Method Details
-
findEntitySnapshotByMetaClassAndEntity
List<EntitySnapshotModel> findEntitySnapshotByMetaClassAndEntity(Object entity, MetaClass entityMetaClass) Loads list of snapshots specific entity. -
findLastSnapshot
Loads last snapshot of specific entity. -
findLastSnapshotById
Loads last snapshot of specific entity. -
saveSnapshot
Save collection of entity snapshots.- Parameters:
entitySnapshots
-EntitySnapshotModel
snapshots for saving
-
save
Save entity snapshot.- Parameters:
entitySnapshotModel
-EntitySnapshotModel
snapshot for saving- Returns:
- saved instance
-