public interface EntitySnapshotService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
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
|
static final java.lang.String NAME
java.util.List<EntitySnapshot> getSnapshots(MetaClass metaClass, java.lang.Object id)
metaClass
- Entity meta classid
- Entity idEntitySnapshot createSnapshot(Entity entity, View view)
entity
- Entityview
- ViewEntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate)
entity
- Entityview
- ViewsnapshotDate
- DateEntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
entity
- Entityview
- ViewsnapshotDate
- Dateauthor
- AuthorEntity extractEntity(EntitySnapshot snapshot)
snapshot
- SnapshotEntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
first
- First snapshotsecond
- Second snapshotvoid migrateSnapshots(MetaClass metaClass, java.lang.Object id, java.util.Map<java.lang.Class,java.lang.Class> classMapping)
metaClass
- Metaclassid
- Entity IdclassMapping
- Map of [OldClass -> NewClass] for migration