Package de.xima.fc.dao.impl
Class FormVersionDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<E>
-
- de.xima.fc.dao.impl.ProjektDependentBaseDao<FormVersion>
-
- de.xima.fc.dao.impl.FormVersionDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<FormVersion,Long,IEntityContext>,IFormVersionDao,IGenericDao<FormVersion>,IProjektDependentBaseDao<FormVersion>
public class FormVersionDao extends ProjektDependentBaseDao<FormVersion> implements IFormVersionDao
-
-
Constructor Summary
Constructors Constructor Description FormVersionDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalcNewVersionNumber(IEntityContext ec, Projekt projekt)FormVersioncopy(IEntityContext ec, FormVersion source, Projekt projekt)FormVersioncreateDefaultFormVersion(IEntityContext ec, Projekt project, IUser user)Returns a new default form version on the basis of a given project.FormVersiongetBy(IEntityContext ec, Projekt projekt, int versionNumber)List<FormVersion>getByFormTheme(IEntityContext ec, Mandant client, FormThemeReference formTheme)Finds all form versions that are associated with the given form theme.List<FormVersion>getByFormThemePlugin(IEntityContext ec, Mandant client, String formThemePluginKey)Finds all form versions that are associated with any theme from the given form theme plugin.List<FormVersion>getByProjekt(IEntityContext ec, Projekt projekt)FormVersiongetByUUID(IEntityContext ec, Projekt project, String uuid)Returns the form version for the given UUID string and projectFormVersiongetByUUID(IEntityContext ec, Projekt project, UUID uuid)Returns the form version for the given UUID and projectFormVersiongetByVersionNumber(IEntityContext ec, Integer formVersionNumber, Long projectId)Gets the form version with the given version number.Set<de.xima.cmn.dao.interfaces.IEntity<Long>>getEntityRefs(IEntityContext ec, FormVersion formversion)Returns a set of entities that reference the given entity and depend on it.com.alibaba.fastjson.JSONObjectgetFormJson(IEntityContext ec, FormVersion formVersion)Returns the form JSON of the given form version.protected IFCDaoActionHook<FormVersion>getPostActionHook()protected IFCDaoActionHook<FormVersion>getPreActionHook()-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
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
-
-
-
-
Method Detail
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, FormVersion formversion)
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<FormVersion>- Overrides:
getEntityRefsin classGenericDao<FormVersion>- Parameters:
ec- entity context for database transactions.formversion- to get references for.- Returns:
- a set of entities that reference the given entity and depend on it.
-
getByProjekt
public List<FormVersion> getByProjekt(IEntityContext ec, Projekt projekt)
- Specified by:
getByProjektin interfaceIFormVersionDao
-
getByUUID
public FormVersion getByUUID(IEntityContext ec, Projekt project, String uuid)
Description copied from interface:IFormVersionDaoReturns the form version for the given UUID string and project- Specified by:
getByUUIDin interfaceIFormVersionDao- Parameters:
ec-IEntityContextto useproject-Projektcontext in which to look for form versionuuid-StringUUID string of the form version- Returns:
FormVersionfor the given UUID and project
-
getByUUID
public FormVersion getByUUID(IEntityContext ec, Projekt project, UUID uuid)
Description copied from interface:IFormVersionDaoReturns the form version for the given UUID and project- Specified by:
getByUUIDin interfaceIFormVersionDao- Parameters:
ec-IEntityContextto useproject-Projektcontext in which to look for form versionuuid-UUIDUUID of the form version- Returns:
FormVersionfor the given UUID and project
-
getBy
public FormVersion getBy(IEntityContext ec, Projekt projekt, int versionNumber)
- Specified by:
getByin interfaceIFormVersionDao
-
calcNewVersionNumber
public int calcNewVersionNumber(IEntityContext ec, Projekt projekt)
- Specified by:
calcNewVersionNumberin interfaceIFormVersionDao
-
copy
public FormVersion copy(IEntityContext ec, FormVersion source, Projekt projekt) throws de.xima.cmn.dao.exceptions.CreateException
- Specified by:
copyin interfaceIFormVersionDao- Throws:
de.xima.cmn.dao.exceptions.CreateException
-
getPreActionHook
protected IFCDaoActionHook<FormVersion> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<FormVersion>
-
getPostActionHook
protected IFCDaoActionHook<FormVersion> getPostActionHook()
- Overrides:
getPostActionHookin classGenericDao<FormVersion>
-
createDefaultFormVersion
public FormVersion createDefaultFormVersion(IEntityContext ec, Projekt project, IUser user)
Description copied from interface:IFormVersionDaoReturns a new default form version on the basis of a given project.- Specified by:
createDefaultFormVersionin interfaceIFormVersionDao- Parameters:
ec-IEntityContextto useproject-Projektcontext in which to create the form versionuser-IUseruser for form file data informations- Returns:
- default
FormVersionfor the given project
-
getByVersionNumber
public FormVersion getByVersionNumber(IEntityContext ec, Integer formVersionNumber, Long projectId)
Description copied from interface:IFormVersionDaoGets the form version with the given version number. Returns the project's default version if the version number is null or no such version exists.- Specified by:
getByVersionNumberin interfaceIFormVersionDao- Parameters:
ec- Entity context for accessing the databaseformVersionNumber- Version number of the form version to get.projectId- ID of the project containing the form version.- Returns:
- Form version with the given version number
-
getByFormThemePlugin
public List<FormVersion> getByFormThemePlugin(IEntityContext ec, Mandant client, String formThemePluginKey)
Description copied from interface:IFormVersionDaoFinds all form versions that are associated with any theme from the given form theme plugin.- Specified by:
getByFormThemePluginin interfaceIFormVersionDao- Parameters:
ec- Entity context for accessing the database.client- The client to which to limit the search. May be null to search all clients.formThemePluginKey- The key of the form theme plugin.- Returns:
- All form versions that are associated with a theme from the given form theme plugin.
-
getByFormTheme
public List<FormVersion> getByFormTheme(IEntityContext ec, Mandant client, FormThemeReference formTheme)
Description copied from interface:IFormVersionDaoFinds all form versions that are associated with the given form theme.- Specified by:
getByFormThemein interfaceIFormVersionDao- Parameters:
ec- Entity context for accessing the database.client- The client to which to limit the search. May be null to search all clients.formTheme- The form theme reference to search for.- Returns:
- All form versions that are associated with the given form theme.
-
getFormJson
public com.alibaba.fastjson.JSONObject getFormJson(IEntityContext ec, FormVersion formVersion)
Description copied from interface:IFormVersionDaoReturns the form JSON of the given form version.- Specified by:
getFormJsonin interfaceIFormVersionDao- Parameters:
ec- Entity context for accessing the database.formVersion- Form version for which to get the form JSON.- Returns:
- Form JSON of the given form version.
-
-