|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Repository<T extends Entity>
Interface defining a repository for storing and retrieving Entity
objects.
Method Summary | ||
---|---|---|
|
count(Specification<V> specification)
Alias of countAllEntitiesSpecifiedBy(Specification) . |
|
|
countAll(Specification<V> specification)
Alias of countAllEntitiesSpecifiedBy(Specification) . |
|
|
countAllEntitiesSpecifiedBy(Specification<V> specification)
Counts the number of entities approved by the given specification. |
|
|
find(Specification<V> specification)
Alias of findAllEntitiesSpecifiedBy(Specification) . |
|
|
findAll(Specification<V> specification)
Alias of findAllEntitiesSpecifiedBy(Specification) . |
|
|
findAllEntitiesSpecifiedBy(Specification<V> specification)
Finds and returns all entities approved by the given specification. |
|
|
findSingle(Specification<V> specification)
Alias of findSingleEntitySpecifiedBy(Specification) . |
|
|
findSingleEntitySpecifiedBy(Specification<V> specification)
Finds and returns one single entity approved by the given specification. |
|
java.lang.Boolean |
isDoingNativePartitioning()
When true , the repository utilizes some sort of native partitioning mechanism, e.g. |
|
java.lang.Boolean |
isDoingRecursiveEntityAdding()
|
|
|
iterate(Specification<V> specification)
Alias of iterateAllEntitiesSpecifiedBy(Specification) . |
|
|
iterateAll(Specification<V> specification)
Alias of iterateAllEntitiesSpecifiedBy(Specification) . |
|
|
iterateAllEntitiesSpecifiedBy(Specification<V> specification)
Finds and returns all entities approved by the given specification. |
|
|
put(V entity)
Puts the given entity into this repository. |
|
|
putAll(java.util.Collection<? extends V> collectionOfEntities)
Puts the given entities into this repository. |
|
|
remove(Specification<V> specification)
Alias of removeAllEntitiesSpecifiedBy(Specification) . |
|
|
remove(V entity)
Removes the given entity from this repository. |
|
|
removeAll(Specification<V> specification)
Alias of removeAllEntitiesSpecifiedBy(Specification) . |
|
|
removeAllEntitiesSpecifiedBy(Specification<V> specification)
Removes all entities approved by the given specification. |
|
void |
setSynchronizer(Synchronizer synchronizer)
A synchronizer used to control concurrent and exclusive access to repository methods. |
|
|
update(V entity)
Updates an entity. |
|
|
update(V entity,
CompositeSpecification<?> deltaSpecification)
Updates an entity. |
Method Detail |
---|
<V extends T> java.lang.Long countAllEntitiesSpecifiedBy(Specification<V> specification)
specification
- the entity specification
java.lang.IllegalArgumentException
- if parameter is null<V extends T> java.lang.Long countAll(Specification<V> specification)
countAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.lang.Long count(Specification<V> specification)
countAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.util.Iterator<V> iterateAllEntitiesSpecifiedBy(Specification<V> specification)
specification
- the entity specification
java.lang.IllegalArgumentException
- if parameter is null<V extends T> java.util.Iterator<V> iterateAll(Specification<V> specification)
iterateAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.util.Iterator<V> iterate(Specification<V> specification)
iterateAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.util.Collection<V> findAllEntitiesSpecifiedBy(Specification<V> specification)
specification
- the entity specification
java.lang.IllegalArgumentException
- if parameter is null<V extends T> java.util.Collection<V> findAll(Specification<V> specification)
findAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.util.Collection<V> find(Specification<V> specification)
findAllEntitiesSpecifiedBy(Specification)
.
<V extends T> V findSingleEntitySpecifiedBy(Specification<V> specification)
specification
- the entity specification
null
if no entity is found
java.lang.IllegalArgumentException
- if parameter is null
java.lang.IllegalArgumentException
- if more then one entity is specified by the given specification<V extends T> V findSingle(Specification<V> specification)
findSingleEntitySpecifiedBy(Specification)
.
<V extends T> void put(V entity)
entity
- the entity to be stored<V extends T> void putAll(java.util.Collection<? extends V> collectionOfEntities)
collectionOfEntities
- the entities to be stored
java.lang.IllegalArgumentException
- if parameter is null<V extends T> void update(V entity)
PersistenceDefinition.FILE
, and possibly PersistenceDefinition.DELEGATED
...
For all other persistence definitions, this method is redundant/not applicable.
Anyway, by applying this method in a consistent manner, an eventual repository migration will not need any code changes.
<V extends T> void update(V entity, CompositeSpecification<?> deltaSpecification)
PersistenceDefinition.FILE
, and possibly PersistenceDefinition.DELEGATED
...
For all other persistence definitions, this method is redundant/not applicable.
Anyway, by applying this method in a consistent manner, an eventual repository migration will not need any code changes.
V
- the entity typeentity
- the entitydeltaSpecification
- for optimistic locking schemes: a specification specifying the differences/added state between this update and the previously retrieved entity version
The specification should be a conjuction of field bound equality specifications only,
or null
if optimistic locking with automatic retries is completely out of scope<V extends T> java.lang.Long removeAllEntitiesSpecifiedBy(Specification<V> specification)
specification
- the entity specification
java.lang.IllegalArgumentException
- if parameter is null<V extends T> java.lang.Long removeAll(Specification<V> specification)
removeAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.lang.Long remove(Specification<V> specification)
removeAllEntitiesSpecifiedBy(Specification)
.
<V extends T> java.lang.Boolean remove(V entity)
entity
- the entity to be removed
true
if the entity is found and removed, otherwise false
java.lang.Boolean isDoingNativePartitioning()
true
, the repository utilizes some sort of native partitioning mechanism, e.g. RDBMS indices.
If true
, partition repositories may be reusing the same repository instance.
true
if repository utilizes some sort of native partitioning mechanism, e.g. RDBMS indices.java.lang.Boolean isDoingRecursiveEntityAdding()
true
if member entities are stored recursively, and made searchable -
false
if only aggregate root is stored.void setSynchronizer(Synchronizer synchronizer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |