@Component(value="cuba_EntitySnapshotManager") public class EntitySnapshotManager extends java.lang.Object implements EntitySnapshotAPI
NAME| Constructor and Description |
|---|
EntitySnapshotManager() |
| Modifier and Type | Method and Description |
|---|---|
EntitySnapshot |
createSnapshot(Entity entity,
View view)
Create snapshot for Entity and store it to database
|
EntitySnapshot |
createSnapshot(Entity entity,
View view,
java.util.Date snapshotDate)
Create snapshot for Entity with specific date and store it to database
|
EntitySnapshot |
createSnapshot(Entity entity,
View view,
java.util.Date snapshotDate,
User author)
Create snapshot for Entity with specific date and author and store it to database
|
Entity |
extractEntity(EntitySnapshot snapshot)
Restore entity by snapshot
|
View |
extractView(EntitySnapshot snapshot)
Restore view from snapshot
|
EntityDiff |
getDifference(EntitySnapshot first,
EntitySnapshot second)
Diff two versions of entity
|
java.util.List<EntitySnapshot> |
getSnapshots(MetaClass metaClass,
java.lang.Object id)
Load snapshots for entity
|
void |
migrateSnapshots(MetaClass metaClass,
java.lang.Object id,
java.util.Map<java.lang.Class,java.lang.Class> classMapping)
Translate snapshots for archival classes
|
public java.util.List<EntitySnapshot> getSnapshots(MetaClass metaClass, java.lang.Object id)
EntitySnapshotAPIgetSnapshots in interface EntitySnapshotAPImetaClass - Entity metaclassid - Entity Idpublic void migrateSnapshots(MetaClass metaClass, java.lang.Object id, java.util.Map<java.lang.Class,java.lang.Class> classMapping)
EntitySnapshotAPImigrateSnapshots in interface EntitySnapshotAPImetaClass - Metaclassid - Entity IdclassMapping - Map of [OldClass -> NewClass] for migrationpublic EntitySnapshot createSnapshot(Entity entity, View view)
EntitySnapshotAPIcreateSnapshot in interface EntitySnapshotAPIentity - Entityview - Viewpublic EntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate)
EntitySnapshotAPIcreateSnapshot in interface EntitySnapshotAPIentity - Entityview - ViewsnapshotDate - Datepublic EntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
EntitySnapshotAPIcreateSnapshot in interface EntitySnapshotAPIentity - Entityview - ViewsnapshotDate - Dateauthor - Authorpublic Entity extractEntity(EntitySnapshot snapshot)
EntitySnapshotAPIextractEntity in interface EntitySnapshotAPIsnapshot - Snapshotpublic View extractView(EntitySnapshot snapshot)
EntitySnapshotAPIextractView in interface EntitySnapshotAPIsnapshot - Snapshotpublic EntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
EntitySnapshotAPIgetDifference in interface EntitySnapshotAPIfirst - First versionsecond - Second version