|
||||||||||
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 | ||
---|---|---|
java.lang.Long |
count(Specification<? extends T> specification)
Alias of countAllEntitiesSpecifiedBy(Specification) . |
|
java.lang.Long |
countAll(Specification<? extends T> specification)
Alias of countAllEntitiesSpecifiedBy(Specification) . |
|
java.lang.Long |
countAllEntitiesSpecifiedBy(Specification<? extends T> 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 |
isIndexingEntitiesRecursively()
|
|
java.lang.Boolean |
isPartitioningNatively()
When true , the repository utilizes some sort of native partitioning mechanism, e.g. |
|
|
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. |
|
PartitionRepository<T> |
makePartition()
Promotes this repository to a PartitionRepository . |
|
|
put(V entity)
Puts the given entity into this repository. |
|
void |
putAll(java.util.Collection<? extends T> 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. |
|
|
update(V entity)
Updates an entity. |
|
|
update(V entity,
Specification<?> deltaSpecification)
Updates an entity. |
Method Detail |
---|
java.lang.Long countAllEntitiesSpecifiedBy(Specification<? extends T> specification)
specification
- the entity specification
java.lang.IllegalArgumentException
- if parameter is nulljava.lang.Long countAll(Specification<? extends T> specification)
countAllEntitiesSpecifiedBy(Specification)
.
java.lang.Long count(Specification<? extends T> 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 storedvoid putAll(java.util.Collection<? extends T> 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, Specification<?> 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
PartitionRepository<T> makePartition()
PartitionRepository
.
java.lang.Boolean isPartitioningNatively()
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 isIndexingEntitiesRecursively()
true
if member entities are stored recursively, and made searchable -
false
if only aggregate root is stored.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |