@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
|
EntitySnapshot |
createTempSnapshot(Entity entity,
View view)
Creates non-persistent snapshot for entity.
|
EntitySnapshot |
createTempSnapshot(Entity entity,
View view,
java.util.Date snapshotDate)
Creates non-persistent snapshot for entity with a specific date.
|
EntitySnapshot |
createTempSnapshot(Entity entity,
View view,
java.util.Date snapshotDate,
User author)
Creates non-persistent snapshot for entity with a specific date and author.
|
Entity |
extractEntity(EntitySnapshot snapshot)
Get entity from snapshot
|
EntityDiff |
getDifference(EntitySnapshot first,
EntitySnapshot second)
Get Diff for snapshots
|
EntitySnapshot |
getLastEntitySnapshot(Entity entity)
Get the last snapshot for the given entity.
|
EntitySnapshot |
getLastEntitySnapshot(MetaClass metaClass,
java.lang.Object id)
Get the last snapshot for the given entity by id.
|
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 migrationpublic EntitySnapshot getLastEntitySnapshot(Entity entity)
EntitySnapshotService
HasUuid
interface.getLastEntitySnapshot
in interface EntitySnapshotService
entity
- entitypublic EntitySnapshot getLastEntitySnapshot(MetaClass metaClass, java.lang.Object id)
EntitySnapshotService
getLastEntitySnapshot
in interface EntitySnapshotService
metaClass
- entity meta classid
- reference id for which snapshot referspublic EntitySnapshot createTempSnapshot(Entity entity, View view)
EntitySnapshotService
HasUuid
interface.createTempSnapshot
in interface EntitySnapshotService
entity
- entityview
- viewpublic EntitySnapshot createTempSnapshot(Entity entity, View view, java.util.Date snapshotDate)
EntitySnapshotService
HasUuid
interface.createTempSnapshot
in interface EntitySnapshotService
entity
- entityview
- entity viewsnapshotDate
- datepublic EntitySnapshot createTempSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
EntitySnapshotService
HasUuid
interface.createTempSnapshot
in interface EntitySnapshotService
entity
- entityview
- entity viewsnapshotDate
- dateauthor
- author