Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 973 Bytes

entity_snapshots_save.adoc

File metadata and controls

16 lines (10 loc) · 973 Bytes
Saving Snapshots

In order to save a snapshot of a given graph of entities, you need to call the EntitySnapshotService.createSnapshot() method passing the entity which is an entry point to the graph and the view describing the graph. The snapshot will be created using the loaded entities without any calls to the database. As a result, the snapshot will not contain the fields that are not included in the view used to load the entity.

The graph of Java objects is converted into XML and saved in the SYS_ENTITY_SNAPSHOT table (corresponding to the EntitySnapshot enitity) together with the link to the primary entity.

Usually, snapshots need to be saved after editor screen commit. This may be achieved by overriding the postCommit() method of the screen controller, for example:

link:../../../../../source/features/entity_snapshots_save.java[role=include]