Package de.xima.fc.dao.impl
Class WorkflowVersionDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<E>
-
- de.xima.fc.dao.impl.ProjektDependentBaseDao<WorkflowVersion>
-
- de.xima.fc.dao.impl.WorkflowVersionDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<WorkflowVersion,Long,IEntityContext>,IGenericDao<WorkflowVersion>,IProjektDependentBaseDao<WorkflowVersion>,IWorkflowVersionDao
public class WorkflowVersionDao extends ProjektDependentBaseDao<WorkflowVersion> implements IWorkflowVersionDao
The default implementation ofIWorkflowVersionDaothat can be accessed viaDaoProvider.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description WorkflowVersionDao()Creates a new instance of this DAO.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowVersioncreateNewWorkflowVersion(Projekt project, long versionNumber)Creates a new workflow version with the default workflow states and an empty process, but does not persist it yet.voiddeleteExistingVersion(IEntityContext ec, WorkflowVersion workflowVersion)Delete an existing (persisted) workflow version.longfindNewVersionNumber(IEntityContext ec, Projekt project)Finds a version number for a new version entity.WorkflowVersiongetActiveByProject(IEntityContext ec, Projekt project)Finds the active workflow version for the given project.WorkflowVersiongetByVersionNumber(IEntityContext ec, Projekt project, long versionNumber)Finds the workflow version with the given version number, if such a version exists.Set<de.xima.cmn.dao.interfaces.IEntity<Long>>getEntityRefs(IEntityContext ec, WorkflowVersion entity)Returns a set of entities that reference the given entity and depend on it.protected IFCDaoActionHook<WorkflowVersion>getPreActionHook()WorkflowVersionloadFullVersion(IEntityContext ec, long workflowVersionId)Loads the workflow version with the given entity and all associated entities (makes sure lazy associations are initiated).WorkflowVersionreplaceVersion(IEntityContext ec, WorkflowVersion oldWorkflowVersion, WorkflowVersion newWorkflowVersion)Replaces the given old workflow version with the data of the new workflow version.WorkflowVersionsaveVersion(IEntityContext ec, WorkflowVersion workflowVersion)Saves the workflow version.-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
getPostActionHook, 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, read
-
-
-
-
Constructor Detail
-
WorkflowVersionDao
public WorkflowVersionDao()
Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.WORKFLOWVERSION_DAO.
-
-
Method Detail
-
createNewWorkflowVersion
public WorkflowVersion createNewWorkflowVersion(Projekt project, long versionNumber)
Description copied from interface:IWorkflowVersionDaoCreates a new workflow version with the default workflow states and an empty process, but does not persist it yet.- Specified by:
createNewWorkflowVersionin interfaceIWorkflowVersionDao- Parameters:
project- Project for which to create a new version.versionNumber- Version number of the workflow version.- Returns:
- A new, non-persisted workflow version.
-
findNewVersionNumber
public long findNewVersionNumber(IEntityContext ec, Projekt project)
Description copied from interface:IWorkflowVersionDaoFinds a version number for a new version entity. It is guaranteed that this number is different from all version numbers of theProjekt.getWorkflowVersions()of the given project.- Specified by:
findNewVersionNumberin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.project- The project with workflow versions for which a new version number is sought.- Returns:
- A new version number different from all version of the given project.
-
getActiveByProject
public WorkflowVersion getActiveByProject(IEntityContext ec, Projekt project)
Description copied from interface:IWorkflowVersionDaoFinds the active workflow version for the given project. Creates a new workflow version when no version exists yet.- Specified by:
getActiveByProjectin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.project- The project for which to find the active workflow version.- Returns:
- The currently active workflow version of the given project. Returns
nullwhen the project does not use the new workflow.
-
replaceVersion
public WorkflowVersion replaceVersion(IEntityContext ec, WorkflowVersion oldWorkflowVersion, WorkflowVersion newWorkflowVersion)
Description copied from interface:IWorkflowVersionDaoReplaces the given old workflow version with the data of the new workflow version. Makes sure to persist all processes, tasks, triggers, and nodes as well.When
oldWorkflowVersionisnull, thenewWorkflowVersionwill be created. WhennewWorkflowVersionisnull, theoldWorkflowVersionwill be deleted.- Specified by:
replaceVersionin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.oldWorkflowVersion- Old workflow version to replace.newWorkflowVersion- New workflow version to replace the old one.- Returns:
- The updated workflow version.
-
saveVersion
public WorkflowVersion saveVersion(IEntityContext ec, WorkflowVersion workflowVersion)
Description copied from interface:IWorkflowVersionDaoSaves the workflow version. Makes sure to persist all processes, tasks, triggers, and nodes as well.- Specified by:
saveVersionin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.workflowVersion- A workflow version to persist.- Returns:
- The newly persisted workflow version.
-
loadFullVersion
public WorkflowVersion loadFullVersion(IEntityContext ec, long workflowVersionId)
Description copied from interface:IWorkflowVersionDaoLoads the workflow version with the given entity and all associated entities (makes sure lazy associations are initiated).- Specified by:
loadFullVersionin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.workflowVersionId- ID of the workflow version to load.- Returns:
- The workflow version with the given ID;
nullwhen no such version exists.
-
deleteExistingVersion
public void deleteExistingVersion(IEntityContext ec, WorkflowVersion workflowVersion)
Description copied from interface:IWorkflowVersionDaoDelete an existing (persisted) workflow version. Makes sure to delete all processes, tasks, triggers, and nodes as well.- Specified by:
deleteExistingVersionin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.workflowVersion- A persisted workflow version to delete.
-
getByVersionNumber
public WorkflowVersion getByVersionNumber(IEntityContext ec, Projekt project, long versionNumber)
Description copied from interface:IWorkflowVersionDaoFinds the workflow version with the given version number, if such a version exists.- Specified by:
getByVersionNumberin interfaceIWorkflowVersionDao- Parameters:
ec- The current entity context to use for interacting with the database.project- The project to search for the workflow version.versionNumber- The version number of the workflow version to find.- Returns:
- The workflow version with the given version number that belong to the given project, or
nullif no such workflow version exists.
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, WorkflowVersion entity)
Description copied from interface:IGenericDaoReturns a set of entities that reference the given entity and depend on it. An entity can usually not be deleted if it is still being referenced by and depended on by other entities.- Specified by:
getEntityRefsin interfaceIGenericDao<WorkflowVersion>- Overrides:
getEntityRefsin classGenericDao<WorkflowVersion>- Parameters:
ec- entity context for database transactions.entity- to get references for.- Returns:
- a set of entities that reference the given entity and depend on it.
-
getPreActionHook
protected IFCDaoActionHook<WorkflowVersion> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<WorkflowVersion>
-
-