public interface EntityService<T extends EntityId,P extends Id,E extends Entity<T,P>,Q extends EntityQuery> extends Service
Modifier and Type | Method and Description |
---|---|
T |
addEntity(E entity,
String description)
Adds the given ad-hoc entity.
|
GlobalId |
addEntityGeneric(E entity,
String description)
Adds the given ad-hoc work entity and returns the persisted global id.
|
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(Q entityQuery)
Counts the entities that match the given query.
|
long |
countEntities(Q entityQuery,
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(Q entityQuery)
Finds the entities that match the given query.
|
List<E> |
findEntities(Q entityQuery,
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(Q entityQuery)
Finds the entity that matches the given query.
|
E |
findEntity(Q entityQuery,
SearchScope searchScope)
Finds the entity that matches the given query in the given scope.
|
E |
findEntityByExternalId(T externalId)
Finds the entity with the given external entity id.
|
E |
findEntityByExternalId(T externalId,
SearchScope searchScope)
Finds the entity with the given external entity id in the given scope.
|
E |
findEntityByGlobalId(GlobalId globalId)
Finds the entity with the given global id.
|
E |
findEntityByGlobalId(GlobalId globalId,
SearchScope searchScope)
Finds the entity with the given entity global id in the given scope.
|
E |
findEntityById(T id)
Finds the entity with the given entity id.
|
E |
findEntityById(T id,
SearchScope searchScope)
Finds the entity with the given entity id in the given scope.
|
T |
findExternalIdByGlobalId(GlobalId globalId)
Returns the external id of the entity with the given id.
|
T |
findExternalIdByGlobalId(GlobalId globalId,
SearchScope searchScope)
Returns the external id of the entity with the given id in the given scope.
|
T |
findExternalIdById(T id)
Returns the external id of the entity with the given id.
|
T |
findExternalIdById(T id,
SearchScope searchScope)
Returns the external id of the entity with the given id in the given scope.
|
GlobalId |
findGlobalIdByExternalId(T externalId)
Returns the global id of the entity with the given external id in the given scope.
|
GlobalId |
findGlobalIdByExternalId(T externalId,
SearchScope searchScope)
Returns the global id of the entity with the given external id in the given scope.
|
T |
findIdByExternalId(T externalId)
Returns the id of the entity with the given external id.
|
T |
findIdByExternalId(T externalId,
SearchScope searchScope)
Returns the id of the entity with the given external id in the given scope.
|
E |
getEntityByGlobalId(GlobalId globalId)
Finds the entity with the given entity id.
|
E |
getEntityByGlobalId(GlobalId globalId,
SearchScope searchScope)
Finds the entity with the given entity id in the given scope.
|
E |
getEntityById(T entityId)
Finds the entity with the given entity id.
|
E |
getEntityById(T entityId,
SearchScope searchScope)
Finds the entity with the given entity id in the given scope.
|
T findExternalIdById(T id)
id
- the id of the entityT findExternalIdById(T id, SearchScope searchScope)
id
- the id of the entitysearchScope
- the scope in which to search for the external idT findExternalIdByGlobalId(GlobalId globalId)
globalId
- the global id of the entityT findExternalIdByGlobalId(GlobalId globalId, SearchScope searchScope)
globalId
- the global id of the entitysearchScope
- the scope in which to search for the external idT findIdByExternalId(T externalId)
externalId
- the external id of the entityT findIdByExternalId(T externalId, SearchScope searchScope)
externalId
- the external id of the entitysearchScope
- the scope in which to search for the idGlobalId findGlobalIdByExternalId(T externalId)
externalId
- the external id of the entityGlobalId findGlobalIdByExternalId(T externalId, SearchScope searchScope)
externalId
- the external id of the entitysearchScope
- the scope in which to search for the idE getEntityById(T entityId)
entityId
- the id of the entity to findEntityNotFoundException
- if entity cannot be foundE getEntityById(T entityId, SearchScope searchScope)
entityId
- the id of the entity to findsearchScope
- the scope in which to search for the entityEntityNotFoundException
- if entity cannot be foundE getEntityByGlobalId(GlobalId globalId)
globalId
- the global id of the entity to findEntityNotFoundException
- if entity cannot be foundE getEntityByGlobalId(GlobalId globalId, SearchScope searchScope)
globalId
- the global id of the entity to findsearchScope
- the scope in which to search for the entityEntityNotFoundException
- if entity cannot be foundE findEntityById(T id)
id
- the id of the entity to findE findEntityById(T id, SearchScope searchScope)
id
- the id of the entity to findsearchScope
- the scope in which to search for the entityE findEntityByGlobalId(GlobalId globalId)
globalId
- the global id of the entity to findE findEntityByGlobalId(GlobalId globalId, SearchScope searchScope)
globalId
- the global id of the entity to findsearchScope
- the scope in which to search for the entity (all-tenant scopes are not supported)E findEntityByExternalId(T externalId)
externalId
- the external id of the entity to findE findEntityByExternalId(T externalId, SearchScope searchScope)
externalId
- the external id of the entity to findsearchScope
- the scope in which to search for the entityE findEntity(Predicate predicate)
Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the queryE findEntity(Predicate predicate, SearchScope searchScope)
Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to search for the entityList<E> findEntities(Predicate predicate)
Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the queryList<E> findEntities(Predicate predicate, SearchScope searchScope)
Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to search for the entitieslong countEntities(Predicate predicate)
predicate
- the predicate to apply when executing the querylong countEntities(Predicate predicate, SearchScope searchScope)
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to count the number of entitiesE findEntity(Q entityQuery)
entityQuery
- the query to executeE findEntity(Q entityQuery, SearchScope searchScope)
entityQuery
- the query to executesearchScope
- the scope in which to search for the entityList<E> findEntities(Q entityQuery)
entityQuery
- the query to executeList<E> findEntities(Q entityQuery, SearchScope searchScope)
entityQuery
- the query to executesearchScope
- the scope in which to search for the entitieslong countEntities(Q entityQuery)
entityQuery
- the query to executelong countEntities(Q entityQuery, SearchScope searchScope)
entityQuery
- the query to executesearchScope
- the scope in which to count number of entitiesT addEntity(E entity, String description)
entity
- the ad-hoc entity to adddescription
- transient meta information regarding the reason to add the ad-hoc entityGlobalId addEntityGeneric(E entity, String description)
If the global id is not set, a new global id is generated by the persistence component of the system and guaranteed to be unique. In all other cases, the contributor of the work object needs to ensure that the global id is unique within the tenant.
entity
- the ad-hoc work object to adddescription
- transient meta information regarding the reason to add the ad-hoc work objectCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.