Package de.xima.fc.api.entity
Class AEntityAPI<T extends ITransferableEntity>
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.entity.AEntityAPI<T>
-
- Type Parameters:
T- Type of the entity, which inherits fromAbstractLockableEntity.
- Direct Known Subclasses:
AktionAPI,AppointmentAPI,AppointmentSlotAPI,AppointmentTemplateAPI,AppointmentTypeAPI,AttachmentAPI,BedingungAPI,BenutzerAPI,BenutzerGruppeAPI,ClientCounterApi,DatenbankZugriffAPI,DatenquelleAPI,EntityberechtigungAPI,FormEingangAPI,FormElementAPI,FormVersionAPI,FrontendServerAPI,FSConnectionAPI,LDAPAbfrageAPI,LDAPGruppeAPI,LDAPZugriffAPI,LicenseFileAPI,MandantAPI,MandantFrontendServerAPI,MandantLdapDataAPI,MandantMailDataAPI,MandantRessourcenAPI,ModulAPI,PostfachAPI,ProjectAuthenticatorConfigAPI,ProjectDOIDataAPI,ProjektAPI,ProjektRessourcenAPI,ProjektZaehlerAPI,ProjektZaehlerDatenAPI,RolleAPI,StatusAPI,SystemPropertyAPI,TextbausteinAPI,VorgangAPI,WorkflowNodeAPI,WorkflowStateAPI,WorkflowTaskAPI,WorkflowTriggerAPI,WorkflowVersionAPI
public abstract class AEntityAPI<T extends ITransferableEntity> extends ASubAPI
Abstract class with diffrent CRUD operations for entities of the typeITransferableEntity.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<T>entityClass
-
Constructor Summary
Constructors Constructor Description AEntityAPI()Instantiates a new entity API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcreate(UserContext uc, T entity)Method for creating a entity.T[]create(UserContext uc, T[] entities)Method for creating multiple entities.Booleandelete(UserContext uc, T entity)Method for deleting a entity.Booleandelete(UserContext uc, T[] entities)Method for deleting multiple entities.BooleandeleteAllBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)Method for deleting entities using aQueryCriteriaManagers.BooleandeleteById(UserContext uc, Integer id)BooleandeleteById(UserContext uc, Long id)Method for deleting a entity by ID.List<T>getAll(UserContext uc)Method for determining all available entities in the user context.List<T>getAllBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)Method for determining all entities using aQueryCriteriaManagers.<C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager>
List<Map<String,Serializable>>getAttributes(UserContext uc, C cm)This method allows for the selection of certain attributes of entities instead of reading the entire entity<R,C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager>
List<R>getAttributes(UserContext uc, C cm, Class<R> resultClass)This method allows for the selection of certain attributes of entities instead of reading the entire entity.TgetBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)Method for determining an entity using aQueryCriteriaManagers.TgetById(UserContext uc, Integer id)TgetById(UserContext uc, Long id)Method for determining an entity by ID.<C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager>
javax.persistence.TuplegetSingleAttributes(UserContext uc, C cm)This method allows for the selection of certain attributes of an entity instead of reading the entire entity<R,C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager>
RgetSingleAttributes(UserContext uc, C cm, Class<R> resultClass)This method allows for the selection of certain attributes of an entity instead of reading the entire entity<C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding>
intresultTotalCount(UserContext uc, C cm)Method for determining the number of hits when searching for entities using aIFilterableCriteriaManager.intresultTotalCount(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)Method for determining the number of hits when searching for entities using aQueryCriteriaManager.Tupdate(UserContext uc, T entity)Method for updating a entity.T[]update(UserContext uc, T[] entities)Method for updating multiple entities.-
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
-
-
-
Field Detail
-
entityClass
protected Class<T extends ITransferableEntity> entityClass
-
-
Method Detail
-
create
public T create(UserContext uc, T entity)
Method for creating a entity.- Parameters:
uc-UserContextthe user context in which the action is to be performed.entity- the entity to be created.- Returns:
- The created entity.
-
create
public T[] create(UserContext uc, T[] entities)
Method for creating multiple entities.- Parameters:
uc-UserContextthe user context in which the action is to be performed.entities- aArrayof the entities to be created.- Returns:
Arrayof the created entities.
-
update
public T update(UserContext uc, T entity)
Method for updating a entity.- Parameters:
uc-UserContextthe user context in which the action is to be performed.entity- the entity to be update.- Returns:
- The updated entity.
-
delete
public Boolean delete(UserContext uc, T entity)
Method for deleting a entity.- Parameters:
uc-UserContextthe user context in which the action is to be performed.entity- the entity to be deleted.- Returns:
Booleanif the deletion was successful.
-
delete
public Boolean delete(UserContext uc, T[] entities)
Method for deleting multiple entities.- Parameters:
uc-UserContextthe user context in which the action is to be performed.entities- aArrayof the entities to be deleted.- Returns:
Booleanif the deletion was successful.
-
update
public T[] update(UserContext uc, T[] entities)
Method for updating multiple entities.- Parameters:
uc-UserContextthe user context in which the action is to be performed.entities- aArrayof the entities to be updated.- Returns:
Arraywith the updated entities.
-
getAll
public List<T> getAll(UserContext uc)
Method for determining all available entities in the user context.- Parameters:
uc-UserContextthe user context in which the action is to be performed.- Returns:
Listof the available entities.
-
getById
public T getById(UserContext uc, Long id)
Method for determining an entity by ID.- Parameters:
uc-UserContextthe user context in which the action is to be performed.id-Integerthe ID of the entity.- Returns:
- The searched entity.
-
getById
public T getById(UserContext uc, Integer id)
-
deleteById
public Boolean deleteById(UserContext uc, Long id)
Method for deleting a entity by ID.- Parameters:
uc-UserContextthe user context in which the action is to be performed.id-Longthe ID of the entity to be deleted.- Returns:
Booleanif the deletion was successful.
-
deleteById
public Boolean deleteById(UserContext uc, Integer id)
-
resultTotalCount
public int resultTotalCount(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining the number of hits when searching for entities using aQueryCriteriaManager.- Parameters:
uc-UserContextthe user context in which the action is to be performed.qcm- theQueryCriteriaManagerwhich should be used for the search.- Returns:
Integerthe found number of entities
-
resultTotalCount
public <C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> int resultTotalCount(UserContext uc, C cm)
Method for determining the number of hits when searching for entities using aIFilterableCriteriaManager.- Parameters:
uc-UserContextthe user context in which the action is to be performed.cm- theIFilterableCriteriaManagerwhich should be used for the search.- Returns:
Integerthe found number of entities
-
getBy
public T getBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining an entity using aQueryCriteriaManagers.- Parameters:
uc-UserContextthe user context in which the action is to be performed.qcm- theQueryCriteriaManagerwhich should be used for the search.- Returns:
- The found entity.
-
getAllBy
public List<T> getAllBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining all entities using aQueryCriteriaManagers.- Parameters:
uc-UserContextthe user context in which the action is to be performed.qcm- theQueryCriteriaManagerwhich should be used for the search.- Returns:
Listthe found entities.
-
getAttributes
public <C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager> List<Map<String,Serializable>> getAttributes(UserContext uc, C cm) throws NotSerializableException
This method allows for the selection of certain attributes of entities instead of reading the entire entity- Type Parameters:
C- type of the criteria manager- Parameters:
uc-UserContextwhich will be used for the transactioncm- the criteria manager used for filtering, sorting, selecting, paging- Returns:
ListofMaps that contain the values of the selected attributes- Throws:
NotSerializableException- when attributes are not serializable
-
getAttributes
public <R,C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager> List<R> getAttributes(UserContext uc, C cm, Class<R> resultClass)
This method allows for the selection of certain attributes of entities instead of reading the entire entity. That result will be returned in form of a list of objects. These objects are defined by the given result class- Type Parameters:
R- type of result classC- type of the criteria manager- Parameters:
uc-UserContextwhich will be used for the transactioncm- the criteria manager used for filtering, sorting, selecting, paging- Returns:
Listof objects that contain the values of the selected attributes
-
getSingleAttributes
public <C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager> javax.persistence.Tuple getSingleAttributes(UserContext uc, C cm)
This method allows for the selection of certain attributes of an entity instead of reading the entire entity- Type Parameters:
T- type of entityC- type of the criteria manager- Parameters:
uc-UserContextwhich will be usedcm-AEntityAPIobject, that contains lists for filtering, sorting and selecting. These lists, if available, are included in the SQL query. This value can benull. The lists contained in theAEntityAPIcan also benullor empty.- Returns:
Tuplethat contains the values of the selected attributes- Since:
- 6.6.0
-
getSingleAttributes
public <R,C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.ISortableCriteriaManager & de.xima.cmn.criteria.interfaces.IPageableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding & de.xima.cmn.criteria.interfaces.ISelectableCriteriaManager> R getSingleAttributes(UserContext uc, C cm, Class<R> resultClass)
This method allows for the selection of certain attributes of an entity instead of reading the entire entity- Type Parameters:
R- type of object, in which the result values will be placedT- type of entityC- type of the criteria manager- Parameters:
ec-UserContextwhich will be usedcm-AEntityAPIobject, that contains lists for filtering, sorting and selecting. These lists, if available, are included in the SQL query. This value can benull. The lists contained in theAEntityAPIcan also benullor empty.resultClass-Classof the object, in which the result value will be placed- Returns:
AEntityAPIthat contains the values of the selected attributes- Since:
- 6.6.0
-
deleteAllBy
public Boolean deleteAllBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for deleting entities using aQueryCriteriaManagers.- Parameters:
uc-UserContextthe user context in which the action is to be performed.qcm- theQueryCriteriaManagerwhich should be used when deleting.- Returns:
Booleanif the deletion was successful.
-
-