public abstract class BaseEntityService<E extends Entity,EB extends Entity.EntityBuilder<E,EB>,OC extends EntityOperandContainer,W extends EntityModification<E,EB>,WB extends EntityModification.EntityModificationBuilder<E,EB,W,WB>,A extends EntityActionEvent<E,WB>,L extends EntityActionListener<A>,M extends EntityManager<E,EB,OC,W,WB>,PROV extends EntityProvider<?>,PERS extends EntityPersistence<E>> extends Object implements EntityService<E>
Base class for all entity object services.
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(L listener)
Deprecated.
|
String |
addEntityGivenByProvider(E entity,
String parentEntityId,
boolean skipDuplicates,
String description)
Adds the given entity that comes from a provider, after converting all references to other entities from external ids to primary ids.
|
long |
countEntities(Predicate predicate)
Counts the entities that match the query with the given predicate.
|
long |
countEntities(Predicate predicate,
SearchScope searchScope)
Counts the entities that match the query with the given predicate in the given scope.
|
long |
countEntities(Query query)
Counts the entities that match the given query.
|
long |
countEntities(Query query,
SearchScope searchScope)
Counts the entities that match the given query in the given scope.
|
List<E> |
findEntities(Predicate predicate)
Finds the entities that match the query with the given predicate.
|
List<E> |
findEntities(Predicate predicate,
SearchScope searchScope)
Finds the entities that match the query with the given predicate in the given scope.
|
List<E> |
findEntities(Query query)
Finds the entities that match the given query.
|
List<E> |
findEntities(Query query,
SearchScope searchScope)
Finds the entities that match the given query in the given scope.
|
E |
findEntity(Predicate predicate)
Finds the entity that matches the query with the given predicate.
|
E |
findEntity(Predicate predicate,
SearchScope searchScope)
Finds the entity that matches the query with the given predicate in the given scope.
|
E |
findEntity(Query query)
Finds the entity that matches the given query.
|
E |
findEntity(Query query,
SearchScope searchScope)
Finds the entity that matches the given query in the given scope.
|
E |
findEntityByExternalId(String externalId)
Finds the entity with the given external entity id.
|
E |
findEntityByExternalId(String externalId,
SearchScope searchScope)
Finds the entity with the given external entity id in the given scope.
|
E |
findEntityByGlobalId(String globalId)
Finds the entity with the given global id.
|
E |
findEntityByGlobalId(String globalId,
SearchScope searchScope)
Finds the entity with the given entity global id in the given scope.
|
E |
findEntityById(String entityId)
Finds the entity with the given entity id.
|
E |
findEntityById(String entityId,
SearchScope searchScope)
Finds the entity with the given entity id in the given scope.
|
String |
findIdByExternalId(String externalId)
Returns the id of the entity with the given external id.
|
String |
findIdByExternalId(String externalId,
SearchScope searchScope)
Returns the id of the entity with the given external id in the given scope.
|
E |
getEntityByGlobalId(String globalId)
Finds the entity with the given entity id.
|
E |
getEntityByGlobalId(String globalId,
SearchScope searchScope)
Finds the entity with the given entity id in the given scope.
|
E |
getEntityById(String entityId)
Finds the entity with the given entity id.
|
E |
getEntityById(String entityId,
SearchScope searchScope)
Finds the entity with the given entity id in the given scope.
|
void |
removeActionListener(L listener)
Deprecated.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, create
public String findIdByExternalId(String externalId)
EntityService
Returns the id of the entity with the given external id.
findIdByExternalId
in interface EntityService<E extends Entity>
externalId
- the external id of the entitypublic String findIdByExternalId(String externalId, SearchScope searchScope)
EntityService
Returns the id of the entity with the given external id in the given scope.
findIdByExternalId
in interface EntityService<E extends Entity>
externalId
- the external id of the entitysearchScope
- the scope in which to search for the idpublic E getEntityById(String entityId)
EntityService
Finds the entity with the given entity id. If no entity matches the given id, an exception is thrown.
getEntityById
in interface EntityService<E extends Entity>
entityId
- the id of the entity to findpublic E getEntityById(String entityId, SearchScope searchScope)
EntityService
Finds the entity with the given entity id in the given scope. If no entity matches the given id, an exception is thrown.
getEntityById
in interface EntityService<E extends Entity>
entityId
- the id of the entity to findsearchScope
- the scope in which to search for the entitypublic E getEntityByGlobalId(String globalId)
EntityService
Finds the entity with the given entity id. If no entity matches the given id, an exception is thrown.
getEntityByGlobalId
in interface EntityService<E extends Entity>
globalId
- the global id of the entity to findpublic E getEntityByGlobalId(String globalId, SearchScope searchScope)
EntityService
Finds the entity with the given entity id in the given scope. If no entity matches the given id, an exception is thrown.
getEntityByGlobalId
in interface EntityService<E extends Entity>
globalId
- the global id of the entity to findsearchScope
- the scope in which to search for the entitypublic E findEntityById(String entityId)
EntityService
Finds the entity with the given entity id. If no entity matches the given id, null is returned.
findEntityById
in interface EntityService<E extends Entity>
entityId
- the id of the entity to findpublic E findEntityById(String entityId, SearchScope searchScope)
EntityService
Finds the entity with the given entity id in the given scope. If no entity matches the given id, null is returned.
findEntityById
in interface EntityService<E extends Entity>
entityId
- the id of the entity to findsearchScope
- the scope in which to search for the entitypublic E findEntityByGlobalId(String globalId)
EntityService
Finds the entity with the given global id. If no entity matches the given global id, null is returned.
findEntityByGlobalId
in interface EntityService<E extends Entity>
globalId
- the global id of the entity to findpublic E findEntityByGlobalId(String globalId, SearchScope searchScope)
EntityService
Finds the entity with the given entity global id in the given scope. If no entity matches the given global id, null is returned.
findEntityByGlobalId
in interface EntityService<E extends Entity>
globalId
- the global id of the entity to findsearchScope
- the scope in which to search for the entity (all-tenant scopes are not supported)public E findEntityByExternalId(String externalId)
EntityService
Finds the entity with the given external entity id. If no entity matches the given external id, null is returned.
findEntityByExternalId
in interface EntityService<E extends Entity>
externalId
- the external id of the entity to findpublic E findEntityByExternalId(String externalId, SearchScope searchScope)
EntityService
Finds the entity with the given external entity id in the given scope. If no entity matches the given external id, null is returned.
findEntityByExternalId
in interface EntityService<E extends Entity>
externalId
- the external id of the entity to findsearchScope
- the scope in which to search for the entitypublic E findEntity(Predicate predicate)
EntityService
Finds the entity that matches the query with the given predicate. If no entity matches the query with the given predicate, null is returned. If more than one entity matches the query with the predicate, an exception is thrown. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
findEntity
in interface EntityService<E extends Entity>
predicate
- the predicate to apply when executing the querypublic E findEntity(Predicate predicate, SearchScope searchScope)
EntityService
Finds the entity that matches the query with the given predicate in the given scope. If no entity matches the query with the given predicate, null is returned. If more than one entity matches the query with the predicate, an exception is thrown. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
findEntity
in interface EntityService<E extends Entity>
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to search for the entitypublic List<E> findEntities(Predicate predicate)
EntityService
Finds the entities that match the query with the given predicate. If no entity matches the query with the given predicate, an empty list is returned. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
findEntities
in interface EntityService<E extends Entity>
predicate
- the predicate to apply when executing the querypublic List<E> findEntities(Predicate predicate, SearchScope searchScope)
EntityService
Finds the entities that match the query with the given predicate in the given scope. If no entity matches the query with the given predicate, an empty list is returned. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
findEntities
in interface EntityService<E extends Entity>
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to search for the entitiespublic long countEntities(Predicate predicate)
EntityService
Counts the entities that match the query with the given predicate.
countEntities
in interface EntityService<E extends Entity>
predicate
- the predicate to apply when executing the querypublic long countEntities(Predicate predicate, SearchScope searchScope)
EntityService
Counts the entities that match the query with the given predicate in the given scope.
countEntities
in interface EntityService<E extends Entity>
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to count the number of entitiespublic E findEntity(Query query)
EntityService
Finds the entity that matches the given query. If no entity matches the given query, null is returned. If more than one entity matches the query, an exception is thrown.
findEntity
in interface EntityService<E extends Entity>
query
- the query to executepublic E findEntity(Query query, SearchScope searchScope)
EntityService
Finds the entity that matches the given query in the given scope. If no entity matches the given query, null is returned. If more than one entity matches the query, an exception is thrown.
findEntity
in interface EntityService<E extends Entity>
query
- the query to executesearchScope
- the scope in which to search for the entitypublic List<E> findEntities(Query query)
EntityService
Finds the entities that match the given query. If no entity matches the given query, an empty list is returned.
findEntities
in interface EntityService<E extends Entity>
query
- the query to executepublic List<E> findEntities(Query query, SearchScope searchScope)
EntityService
Finds the entities that match the given query in the given scope. If no entity matches the given query, an empty list is returned.
findEntities
in interface EntityService<E extends Entity>
query
- the query to executesearchScope
- the scope in which to search for the entitiespublic long countEntities(Query query)
EntityService
Counts the entities that match the given query.
countEntities
in interface EntityService<E extends Entity>
query
- the query to executepublic long countEntities(Query query, SearchScope searchScope)
EntityService
Counts the entities that match the given query in the given scope.
countEntities
in interface EntityService<E extends Entity>
query
- the query to executesearchScope
- the scope in which to count number of entitiespublic final String addEntityGivenByProvider(E entity, String parentEntityId, boolean skipDuplicates, String description)
Adds the given entity that comes from a provider, after converting all references to other entities from external ids to primary ids.
If the entity’s id is set to null
, the entity id is generated by the persistence component of the system and guaranteed to be unique.
In all other cases, the provider of the entity needs to ensure that the entity’s id is unique.
If the entity is already persisted, the action is silently aborted if the <i>skipDuplicates</i> flag is set to <i>true</i>.
entity
- the entity that comes from a provider to addskipDuplicates
- if <i>true</i> and entity is already persisted, abort silentlydescription
- transient meta information regarding the reason to add the entity that comes from a provider@Deprecated public void addActionListener(L listener)
@Deprecated public void removeActionListener(L listener)
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.