Package de.xima.fc.dao.impl
Class WorkflowVersionBackupDao
java.lang.Object
de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<WorkflowVersionBackup,
,Long, IEntityContext> IGenericDao<WorkflowVersionBackup>
,IWorkflowVersionBackupDao
public class WorkflowVersionBackupDao
extends GenericDao<WorkflowVersionBackup>
implements IWorkflowVersionBackupDao
The default implementation of
IWorkflowVersionBackupDao
that can be accessed via DaoProvider
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from class de.xima.cmn.dao.AbstractDao
entityClass, LOG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallByWorkflowVersion
(IEntityContext ec, WorkflowVersion workflowVersion) Retrieves all available backups for the given workflow version, sorted in ascending order bygetDateCreated()
.createNewBackup
(IEntityContext ec, WorkflowVersion workflowVersion, String backupData) Creates a new workflow version backup with the data of the given workflow version.void
deleteAllByWorkflowVersion
(IEntityContext ec, WorkflowVersion workflowVersion) Deletes all backups for the given workflow version.Methods inherited from class de.xima.fc.dao.impl.GenericDao
getEntityRefs, getPostActionHook, getPreActionHook, read
Methods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
Constructor Details
-
WorkflowVersionBackupDao
public WorkflowVersionBackupDao()Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.WORKFLOWVERSIONBACKUP_DAO
.
-
-
Method Details
-
allByWorkflowVersion
public List<WorkflowVersionBackup> allByWorkflowVersion(IEntityContext ec, WorkflowVersion workflowVersion) Description copied from interface:IWorkflowVersionBackupDao
Retrieves all available backups for the given workflow version, sorted in ascending order bygetDateCreated()
.- Specified by:
allByWorkflowVersion
in interfaceIWorkflowVersionBackupDao
- Parameters:
ec
- Current entity context for accessing the database.workflowVersion
- Workflow version for which to retrieve all backups- Returns:
- All existing backups for the given workflow version, sorted in ascending order by
getDateCreated()
.
-
createNewBackup
public WorkflowVersionBackup createNewBackup(IEntityContext ec, WorkflowVersion workflowVersion, String backupData) Description copied from interface:IWorkflowVersionBackupDao
Creates a new workflow version backup with the data of the given workflow version. Enforces a limit on the number of backups. No more than the specified number of backups will be present after the new backup was created. When the number of backups exceeds the limit, the oldest backups are deleted.- Specified by:
createNewBackup
in interfaceIWorkflowVersionBackupDao
- Parameters:
ec
- Current entity context for accessing the database.workflowVersion
- Workflow version to backup.backupData
- Backup JSON data to store.- Returns:
- The newly created backup.
-
deleteAllByWorkflowVersion
Description copied from interface:IWorkflowVersionBackupDao
Deletes all backups for the given workflow version.- Specified by:
deleteAllByWorkflowVersion
in interfaceIWorkflowVersionBackupDao
- Parameters:
ec
- Current entity context for accessing the database.workflowVersion
- Workflow version for which to delete all backups
-