public class GenericAPI extends ASubAPI
| Constructor and Description | 
|---|
GenericAPI()  | 
| Modifier and Type | Method and Description | 
|---|---|
<T extends ITransferableEntity> | 
create(Class<T> entityClass,
      UserContext uc,
      T entity)
Method for creating a entity of a defined class. 
 | 
<T extends ITransferableEntity> | 
create(Class<T> entityClass,
      UserContext uc,
      T[] entities)
Method for creating multiple entities of a defined class. 
 | 
<T extends ITransferableEntity> | 
delete(Class<T> entityClass,
      UserContext uc,
      T entity)
Method for deleting a entity of a defined class. 
 | 
<T extends ITransferableEntity> | 
delete(Class<T> entityClass,
      UserContext uc,
      T[] entities)
Method for deleting multiple entities of a defined class. 
 | 
<T extends ITransferableEntity,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> | 
deleteAllBy(Class<T> entityClass,
           UserContext uc,
           C cm)
Method for deleting multiple entities of a defined class by ID. 
 | 
<T extends ITransferableEntity> | 
deleteAllBy(Class<T> entityClass,
           UserContext uc,
           de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for deleting multiple entities of a defined class by ID. * @param  
 | 
<T extends ITransferableEntity> | 
deleteById(Class<T> entityClass,
          UserContext uc,
          Integer id)  | 
<T extends ITransferableEntity> | 
deleteById(Class<T> entityClass,
          UserContext uc,
          Long id)
Method for deleting a entity of a defined class by ID. 
 | 
<T extends ITransferableEntity> | 
getAll(Class<T> entityClass,
      UserContext uc)
Method for determining all entities. 
 | 
<T extends ITransferableEntity,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> | 
getAll(Class<T> entityClass,
      UserContext uc,
      C cm)
Method for determining all entities of a defined class using a criteria manager. 
 | 
<T extends ITransferableEntity> | 
getAll(Class<T> entityClass,
      UserContext uc,
      de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining all entities of a defined class using a  
QueryCriteriaManagers. | 
<T extends ITransferableEntity,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(Class<T> entityClass,
             UserContext uc,
             C cm)  | 
<R,T extends ITransferableEntity,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(Class<T> entityClass,
             UserContext uc,
             C cm,
             Class<R> resultClass)  | 
<T extends ITransferableEntity,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> | 
getBy(Class<T> entityClass,
     UserContext uc,
     C cm)
Method for determining an entity using a  
QueryCriteriaManager. | 
<T extends ITransferableEntity> | 
getBy(Class<T> entityClass,
     UserContext uc,
     de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining an entity using a  
QueryCriteriaManager. | 
<T extends ITransferableEntity> | 
getById(Class<T> entityClass,
       UserContext uc,
       Integer id)  | 
<T extends ITransferableEntity> | 
getById(Class<T> entityClass,
       UserContext uc,
       Long id)
Method for reading a entity by class and ID. 
 | 
<T extends ITransferableEntity> | 
getById(UserContext uc,
       String entityClassName,
       String id)
Method for reading an entity by its class name and ID. 
 | 
<T extends ITransferableEntity,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(Class<T> entityClass,
                   UserContext uc,
                   C cm)
This method allows for the selection of certain attributes of an entity instead of reading the entire entity 
 | 
<R,T extends ITransferableEntity,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(Class<T> entityClass,
                   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 
 | 
<T extends ITransferableEntity,C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> | 
resultTotalCount(Class<T> entityClass,
                UserContext uc,
                C cm)
Method for determining the number of found entities based on their class. 
 | 
<T extends ITransferableEntity> | 
resultTotalCount(Class<T> entityClass,
                UserContext uc,
                de.xima.cmn.criteria.QueryCriteriaManager qcm)
Method for determining the number of found entities based on their class. 
 | 
<T extends ITransferableEntity> | 
update(Class<T> entityClass,
      UserContext uc,
      T entity)
Method for updating a entity of a defined class. 
 | 
<T extends ITransferableEntity> | 
update(Class<T> entityClass,
      UserContext uc,
      T[] entities)
Method for updating multiple entities of a defined class. 
 | 
getHandlerProviderpublic <T extends ITransferableEntity> List<T> getAll(Class<T> entityClass, UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
QueryCriteriaManagers.T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.qcm - QueryCriteriaManager to be filtered by.List from ITransferableEntity which were found.public <T extends ITransferableEntity,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> List<T> getAll(Class<T> entityClass, UserContext uc, C cm)
T - the type of the entityC - the type of the criteria managerentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.cm - the criteria manager to be filtered by.List from ITransferableEntity which were found.public <T extends ITransferableEntity> T create(Class<T> entityClass, UserContext uc, T entity)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.entity - ITransferableEntity which should be created.ITransferableEntity which is created.public <T extends ITransferableEntity> T[] create(Class<T> entityClass, UserContext uc, T[] entities)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.entities - Array the entities to create.Array of the created entities.public <T extends ITransferableEntity> boolean delete(Class<T> entityClass, UserContext uc, T entity)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.entity - ITransferableEntity which should be deleted.Boolean whether the deletion was successful or not.public <T extends ITransferableEntity> boolean delete(Class<T> entityClass, UserContext uc, T[] entities)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.entities - Array the entities to be deleted.Boolean whether the deletion was successful or not.public <T extends ITransferableEntity> T getById(Class<T> entityClass, UserContext uc, Long id)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.id - Long the ID of the searched entity.ITransferableEntity the found entity.public <T extends ITransferableEntity> T getById(Class<T> entityClass, UserContext uc, Integer id)
public <T extends ITransferableEntity> T getById(UserContext uc, String entityClassName, String id)
T - the type of the entityuc - UserContext the user context in which the action is to be performed.entityClassName - String the class name of the searched entity.id - Integer the ID of the searched entity.ITransferableEntity the found entity.public <T extends ITransferableEntity,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(Class<T> entityClass, UserContext uc, C cm) throws NotSerializableException
NotSerializableExceptionpublic <R,T extends ITransferableEntity,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(Class<T> entityClass, UserContext uc, C cm, Class<R> resultClass)
public <T extends ITransferableEntity,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(Class<T> entityClass, UserContext uc, C cm)
T - type of entityC - type of the criteria managerentityClass - Class the class of the searched entityuc - 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,T extends ITransferableEntity,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(Class<T> entityClass, 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 managerentityClass - Class the class of the searched entityuc - 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 <T extends ITransferableEntity> int resultTotalCount(Class<T> entityClass, UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.qcm - QueryCriteriaManager to be searched by.Integer the found number of elements QueryCriteriaManagers.public <T extends ITransferableEntity,C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> int resultTotalCount(Class<T> entityClass, UserContext uc, C cm)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.cm - the criteria manager to be searched by.Integer the found number of elements.public <T extends ITransferableEntity> T[] update(Class<T> entityClass, UserContext uc, T[] entities)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.entities - Array the entities to be updated.Array the updated entities.public <T extends ITransferableEntity> T update(Class<T> entityClass, UserContext uc, T entity)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.entity - ITransferableEntity which should be updated.ITransferableEntity the updated entity.public <T extends ITransferableEntity> T getBy(Class<T> entityClass, UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
QueryCriteriaManager.T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.qcm - the QueryCriteriaManager to be searched by.public <T extends ITransferableEntity,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> T getBy(Class<T> entityClass, UserContext uc, C cm)
QueryCriteriaManager.T - the type of the entityC - the type of the criteria managerentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.cm - the criteria manager to be searched by.public <T extends ITransferableEntity> Boolean deleteAllBy(Class<T> entityClass, UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
entityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.qcm - QueryCriteriaManager to be searched by.Boolean whether the deletion was successful or not.public <T extends ITransferableEntity,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> Boolean deleteAllBy(Class<T> entityClass, UserContext uc, C cm)
T - the type of the entityC - the type of the criteria managerentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.cm - the criteria manager to be searched by.Boolean whether the deletion was successful or not.public <T extends ITransferableEntity> Boolean deleteById(Class<T> entityClass, UserContext uc, Long id)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.id - Long the ID of the searched entity.Boolean whether the deletion was successful or not.public <T extends ITransferableEntity> Boolean deleteById(Class<T> entityClass, UserContext uc, Integer id)
public <T extends ITransferableEntity> List<T> getAll(Class<T> entityClass, UserContext uc)
T - the type of the entityentityClass - ITransferableEntity class of the entity.uc - UserContext the user context in which the action is to be performed.List of the found entities.Copyright © 2020 XIMA MEDIA GmbH. All rights reserved.