T - Type of the entity, which inherits from AbstractLockableEntity.public abstract class AEntityAPI<T extends ITransferableEntity> extends ASubAPI
ITransferableEntity.| Modifier and Type | Field and Description | 
|---|---|
protected Class<T> | 
entityClass  | 
| Constructor and Description | 
|---|
AEntityAPI()
Instantiates a new entity API. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
T | 
create(UserContext uc,
      T entity)
Method for creating a entity. 
 | 
T[] | 
create(UserContext uc,
      T[] entities)
Method for creating multiple entities. 
 | 
Boolean | 
delete(UserContext uc,
      T entity)
Method for deleting a entity. 
 | 
Boolean | 
delete(UserContext uc,
      T[] entities)
Method for deleting multiple entities. 
 | 
Boolean | 
deleteAllBy(UserContext uc,
           de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for deleting entities using a  
QueryCriteriaManagers. | 
Boolean | 
deleteById(UserContext uc,
          Integer id)  | 
Boolean | 
deleteById(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 a  
QueryCriteriaManagers. | 
<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> | 
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> | 
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. 
 | 
T | 
getBy(UserContext uc,
     de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining an entity using a  
QueryCriteriaManagers. | 
T | 
getById(UserContext uc,
       Integer id)  | 
T | 
getById(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> | 
getSingleAttributes(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> | 
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 
 | 
<C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> | 
resultTotalCount(UserContext uc,
                C cm)
Method for determining the number of hits when searching for entities using a  
IFilterableCriteriaManager. | 
int | 
resultTotalCount(UserContext uc,
                de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining the number of hits when searching for entities using a  
QueryCriteriaManager. | 
T | 
update(UserContext uc,
      T entity)
Method for updating a entity. 
 | 
T[] | 
update(UserContext uc,
      T[] entities)
Method for updating multiple entities. 
 | 
getHandlerProviderprotected Class<T extends ITransferableEntity> entityClass
public T create(UserContext uc, T entity)
uc - UserContext the user context in which the action is to be performed.entity - the entity to be created.public T[] create(UserContext uc, T[] entities)
uc - UserContext the user context in which the action is to be performed.entities - a Array of the entities to be created.Array of the created entities.public T update(UserContext uc, T entity)
uc - UserContext the user context in which the action is to be performed.entity - the entity to be update.public Boolean delete(UserContext uc, T entity)
uc - UserContext the user context in which the action is to be performed.entity - the entity to be deleted.Boolean if the deletion was successful.public Boolean delete(UserContext uc, T[] entities)
uc - UserContext the user context in which the action is to be performed.entities - a Array of the entities to be deleted.Boolean if the deletion was successful.public T[] update(UserContext uc, T[] entities)
uc - UserContext the user context in which the action is to be performed.entities - a Array of the entities to be updated.Array with the updated entities.public List<T> getAll(UserContext uc)
uc - UserContext the user context in which the action is to be performed.List of the available entities.public T getById(UserContext uc, Long id)
uc - UserContext the user context in which the action is to be performed.id - Integer the ID of the entity.public T getById(UserContext uc, Integer id)
public Boolean deleteById(UserContext uc, Long id)
uc - UserContext the user context in which the action is to be performed.id - Long the ID of the entity to be deleted.Boolean if the deletion was successful.public Boolean deleteById(UserContext uc, Integer id)
public int resultTotalCount(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
QueryCriteriaManager.uc - UserContext the user context in which the action is to be performed.qcm - the QueryCriteriaManager which should be used for the search.Integer the found number of entitiespublic <C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> int resultTotalCount(UserContext uc, C cm)
IFilterableCriteriaManager.uc - UserContext the user context in which the action is to be performed.cm - the IFilterableCriteriaManager which should be used for the search.Integer the found number of entitiespublic T getBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
QueryCriteriaManagers.uc - UserContext the user context in which the action is to be performed.qcm - the QueryCriteriaManager which should be used for the search.public List<T> getAllBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
QueryCriteriaManagers.uc - UserContext the user context in which the action is to be performed.qcm - the QueryCriteriaManager which should be used for the search.List the found entities.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
C - type of the criteria manageruc - UserContext which will be used for the transactioncm - the criteria manager used for filtering, sorting, selecting, pagingList of Maps that contain the values of the selected attributesNotSerializableException - when attributes are not serializablepublic <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)
R - type of result classC - type of the criteria manageruc - UserContext which will be used for the transactioncm - the criteria manager used for filtering, sorting, selecting, pagingList of objects that contain the values of the selected attributespublic <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)
T - type of entityC - type of the criteria manageruc - UserContext which will be usedcm - C object, that contains lists for filtering, sorting and selecting. These lists, if available,
 are included in the SQL query. This value can be null. The lists contained in the C can also
 be null or empty.Tuple that contains the values of the selected attributespublic <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)
R - type of object, in which the result values will be placedT - type of entityC - type of the criteria managerec - UserContext which will be usedcm - C object, that contains lists for filtering, sorting and selecting. These lists, if available,
 are included in the SQL query. This value can be null. The lists contained in the C can also
 be null or empty.resultClass - Class of the object, in which the result value will be placedR that contains the values of the selected attributespublic Boolean deleteAllBy(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
QueryCriteriaManagers.uc - UserContext the user context in which the action is to be performed.qcm - the QueryCriteriaManager which should be used when deleting.Boolean if the deletion was successful.Copyright © 2020 XIMA MEDIA GmbH. All rights reserved.