|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>
A repository represents a collection of a specific type of objects. Typically,
the implementation of a repository involves a database or an ORM mapping tool,
but simple Sets can be used also for testing purposes.
| Method Summary | |
|---|---|
EntityType |
add(EntityType entity)
Adds the entity to this repository. |
boolean |
contains(EntityType entity)
Returns whether or not the entity is contained within the repository. |
Set<EntityType> |
getAll()
Returns all entities in this repository as a set. |
EntityType |
getById(IdType id)
Returns the entity with the given id. |
void |
remove(EntityType entity)
Removes the entity from this repository. |
int |
size()
Returns the size of the repository. |
EntityType |
update(EntityType entity)
Updates an entity within this repository. |
| Method Detail |
|---|
EntityType add(EntityType entity)
entity - the entity
boolean contains(EntityType entity)
entity - the entity
Set<EntityType> getAll()
EntityType getById(IdType id)
id - the id
void remove(EntityType entity)
entity - the entityEntityType update(EntityType entity)
entity - the entity
int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||