Class EntitySnapshotDataStoreImpl
java.lang.Object
io.jmix.audit.snapshot.datastore.impl.EntitySnapshotDataStoreImpl
- All Implemented Interfaces:
EntitySnapshotDataStore
@Component("audit_EntitySnapshotDataStore")
public class EntitySnapshotDataStoreImpl
extends Object
implements EntitySnapshotDataStore
-
Constructor Summary
ConstructorDescriptionEntitySnapshotDataStoreImpl
(ReferenceToEntitySupport referenceToEntitySupport, Metadata metadata, UnconstrainedDataManager unconstrainedDataManager, ExtendedEntities extendedEntities, EntitySnapshotModelConverter entitySnapshotModelConverter) -
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 metaClass) Loads last snapshot of specific entity.save
(EntitySnapshotModel entitySnapshotModel) Save entity snapshot.void
saveSnapshot
(Collection<EntitySnapshotModel> entitySnapshots) Save collection of entity snapshots.
-
Constructor Details
-
EntitySnapshotDataStoreImpl
public EntitySnapshotDataStoreImpl(ReferenceToEntitySupport referenceToEntitySupport, Metadata metadata, UnconstrainedDataManager unconstrainedDataManager, ExtendedEntities extendedEntities, EntitySnapshotModelConverter entitySnapshotModelConverter)
-
-
Method Details
-
findEntitySnapshotByMetaClassAndEntity
public List<EntitySnapshotModel> findEntitySnapshotByMetaClassAndEntity(Object entity, MetaClass entityMetaClass) Description copied from interface:EntitySnapshotDataStore
Loads list of snapshots specific entity.- Specified by:
findEntitySnapshotByMetaClassAndEntity
in interfaceEntitySnapshotDataStore
- Parameters:
entity
-Object
object, defining entity id what will be used for load snapshotsentityMetaClass
-MetaClass
object, defining the type of snapshots- Returns:
- list of snapshots, or an empty list if not found
-
findLastSnapshot
Description copied from interface:EntitySnapshotDataStore
Loads last snapshot of specific entity.- Specified by:
findLastSnapshot
in interfaceEntitySnapshotDataStore
- Parameters:
entity
-Object
object, defining entity id what will be used for load snapshotentityMetaClass
-MetaClass
object, defining the type of the snapshot- Returns:
- load snapshot, or null if not found
-
findLastSnapshotById
Description copied from interface:EntitySnapshotDataStore
Loads last snapshot of specific entity.- Specified by:
findLastSnapshotById
in interfaceEntitySnapshotDataStore
- Parameters:
referenceId
-Object
object, defining entity id what will be used for load snapshotmetaClass
-MetaClass
object, defining the type of the snapshot- Returns:
- load snapshot, or null if not found
-
saveSnapshot
Description copied from interface:EntitySnapshotDataStore
Save collection of entity snapshots.- Specified by:
saveSnapshot
in interfaceEntitySnapshotDataStore
- Parameters:
entitySnapshots
-EntitySnapshotModel
snapshots for saving
-
save
Description copied from interface:EntitySnapshotDataStore
Save entity snapshot.- Specified by:
save
in interfaceEntitySnapshotDataStore
- Parameters:
entitySnapshotModel
-EntitySnapshotModel
snapshot for saving- Returns:
- saved instance
-