@Service(value="cuba_EntitySnapshotService") public class EntitySnapshotServiceBean extends java.lang.Object implements EntitySnapshotService
NAME
Constructor and Description |
---|
EntitySnapshotServiceBean() |
Modifier and Type | Method and Description |
---|---|
EntitySnapshot |
createSnapshot(Entity entity,
View view)
Create snapshot for entity and save 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)
Get entity from snapshot
|
EntityDiff |
getDifference(EntitySnapshot first,
EntitySnapshot second)
Get Diff for snapshots
|
java.util.List<EntitySnapshot> |
getSnapshots(MetaClass metaClass,
java.lang.Object id)
Get snapshots for entity by id
|
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)
EntitySnapshotService
getSnapshots
in interface EntitySnapshotService
metaClass
- Entity meta classid
- Entity idpublic EntitySnapshot createSnapshot(Entity entity, View view)
EntitySnapshotService
createSnapshot
in interface EntitySnapshotService
entity
- Entityview
- Viewpublic EntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate)
EntitySnapshotService
createSnapshot
in interface EntitySnapshotService
entity
- Entityview
- ViewsnapshotDate
- Datepublic EntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
EntitySnapshotService
createSnapshot
in interface EntitySnapshotService
entity
- Entityview
- ViewsnapshotDate
- Dateauthor
- Authorpublic Entity extractEntity(EntitySnapshot snapshot)
EntitySnapshotService
extractEntity
in interface EntitySnapshotService
snapshot
- Snapshotpublic EntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
EntitySnapshotService
getDifference
in interface EntitySnapshotService
first
- First snapshotsecond
- Second snapshotpublic void migrateSnapshots(MetaClass metaClass, java.lang.Object id, java.util.Map<java.lang.Class,java.lang.Class> classMapping)
EntitySnapshotService
migrateSnapshots
in interface EntitySnapshotService
metaClass
- Metaclassid
- Entity IdclassMapping
- Map of [OldClass -> NewClass] for migration