Package com.logicaldoc.workflow.template
Class HibernateWorkflowTemplateDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<WorkflowTemplate>
-
- com.logicaldoc.workflow.template.HibernateWorkflowTemplateDAO
-
- All Implemented Interfaces:
com.logicaldoc.core.PersistentObjectDAO<WorkflowTemplate>,WorkflowTemplateDAO
public class HibernateWorkflowTemplateDAO extends com.logicaldoc.core.HibernatePersistentObjectDAO<WorkflowTemplate> implements WorkflowTemplateDAO
Hibernate implementation of theWorkflowTemplateDAO.- Since:
- 5.0
- Author:
- Sebastian Wenzky, Matteo Caruso - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowTemplatecreateFromFile(File file)De-serialize a template from a filebooleandelete(long id, int code)WorkflowTemplatedeploy(WorkflowTemplate wfTemplate)This method deploys the given persistence workflow template that is it copies the draft scheme in the currently used scheme and produces a new version.List<WorkflowTemplate>findAll(long tenantId)List<WorkflowTemplate>findAllByName(long tenantId, String name)This method finds all the workflow templates by nameList<WorkflowTemplate>findAllDeployed(Long tenantId)This method loads all the workflow already deployedWorkflowTemplatefindById(long id)WorkflowTemplatefindByName(long tenantId, String name)This method finds a workflow template by name (the latest version is returned)WorkflowTemplatefindByNameAndVersion(long tenantId, String name, int version)This method finds a workflow template by name (the latest version is returned)WorkflowTemplatefindLastDeployed(long tenantId, String name)This method finds a deployed workflow template by name (the latest deployed version is returned)WorkflowTemplatestoreNewVersion(WorkflowTemplate wfTemplate)Saves the passed workflow as a new version-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAllIds, findAllIds, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory, store
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAllIds, findAllIds, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
createFromFile
public WorkflowTemplate createFromFile(File file)
Description copied from interface:WorkflowTemplateDAODe-serialize a template from a file- Specified by:
createFromFilein interfaceWorkflowTemplateDAO- Parameters:
file- the file storing the template- Returns:
- object representation of the template
-
findAllDeployed
public List<WorkflowTemplate> findAllDeployed(Long tenantId)
Description copied from interface:WorkflowTemplateDAOThis method loads all the workflow already deployed- Specified by:
findAllDeployedin interfaceWorkflowTemplateDAO- Parameters:
tenantId- optional tenant specification- Returns:
- list of persistence workflow template
-
findById
public WorkflowTemplate findById(long id)
- Specified by:
findByIdin interfacecom.logicaldoc.core.PersistentObjectDAO<WorkflowTemplate>- Overrides:
findByIdin classcom.logicaldoc.core.HibernatePersistentObjectDAO<WorkflowTemplate>
-
deploy
public WorkflowTemplate deploy(WorkflowTemplate wfTemplate) throws com.logicaldoc.core.PersistenceException
Description copied from interface:WorkflowTemplateDAOThis method deploys the given persistence workflow template that is it copies the draft scheme in the currently used scheme and produces a new version.- Specified by:
deployin interfaceWorkflowTemplateDAO- Parameters:
wfTemplate- The persistence workflow template- Returns:
- the next version of the template
- Throws:
com.logicaldoc.core.PersistenceException- error in the database
-
storeNewVersion
public WorkflowTemplate storeNewVersion(WorkflowTemplate wfTemplate) throws com.logicaldoc.core.PersistenceException
Description copied from interface:WorkflowTemplateDAOSaves the passed workflow as a new version- Specified by:
storeNewVersionin interfaceWorkflowTemplateDAO- Parameters:
wfTemplate- The persistence workflow template- Returns:
- the next version of the template
- Throws:
com.logicaldoc.core.PersistenceException- error in the database
-
findByName
public WorkflowTemplate findByName(long tenantId, String name)
Description copied from interface:WorkflowTemplateDAOThis method finds a workflow template by name (the latest version is returned)- Specified by:
findByNamein interfaceWorkflowTemplateDAO- Parameters:
tenantId- identifier of the tenantname- name of the workflow template- Returns:
WorkflowTemplatewith given name, latest version
-
findLastDeployed
public WorkflowTemplate findLastDeployed(long tenantId, String name)
Description copied from interface:WorkflowTemplateDAOThis method finds a deployed workflow template by name (the latest deployed version is returned)- Specified by:
findLastDeployedin interfaceWorkflowTemplateDAO- Parameters:
tenantId- identifier of the tenantname- name of the workflow template- Returns:
WorkflowTemplatewith given name, latest version
-
findAllByName
public List<WorkflowTemplate> findAllByName(long tenantId, String name)
Description copied from interface:WorkflowTemplateDAOThis method finds all the workflow templates by name- Specified by:
findAllByNamein interfaceWorkflowTemplateDAO- Parameters:
tenantId- identifier of the tenantname- name of the workflow template- Returns:
- list of templates with same name ordered by descending version
-
findByNameAndVersion
public WorkflowTemplate findByNameAndVersion(long tenantId, String name, int version)
Description copied from interface:WorkflowTemplateDAOThis method finds a workflow template by name (the latest version is returned)- Specified by:
findByNameAndVersionin interfaceWorkflowTemplateDAO- Parameters:
tenantId- identifier of the tenantname- name of the workflow templateversion- what version to pick- Returns:
WorkflowTemplatewith given name, latest version
-
findAll
public List<WorkflowTemplate> findAll(long tenantId)
- Specified by:
findAllin interfacecom.logicaldoc.core.PersistentObjectDAO<WorkflowTemplate>- Overrides:
findAllin classcom.logicaldoc.core.HibernatePersistentObjectDAO<WorkflowTemplate>
-
delete
public boolean delete(long id, int code) throws com.logicaldoc.core.PersistenceException- Specified by:
deletein interfacecom.logicaldoc.core.PersistentObjectDAO<WorkflowTemplate>- Overrides:
deletein classcom.logicaldoc.core.HibernatePersistentObjectDAO<WorkflowTemplate>- Throws:
com.logicaldoc.core.PersistenceException
-
-