|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
P - the type of the entity which contains the collection to update.E - the type of entities in the collection.public interface ListUpdator<P,E>
A simple contract to allow you to update some collections of an entity.
The purpose of the contract is to make possible (via a StorageService for example) some automatic and generic behaviour when you want to set a collection of childs into a entity.
| Method Summary | |
|---|---|
void |
addToList(P parent,
E e)
Add a erntity to his parent |
E |
getChild(P parent,
String topiaId)
Obtain a child from the entity given his id. |
Collection<E> |
getChilds(P parent)
Obtain the collection of childs from the entity. |
String |
getPropertyName()
Obtain the name of the property containing childs. |
boolean |
isEmpty(P parent)
Tests if the given entity has some childs. |
void |
removeAll(P parent)
Remove all childs of the given parent. |
void |
removeFromList(P parent,
E e)
Remove from a prent entity a given child. |
void |
setChilds(P parent,
Collection<E> childs)
Set the childs of an entity |
int |
size(P parent)
Obtain the number of childs for the given parent. |
| Method Detail |
|---|
String getPropertyName()
E getChild(P parent,
String topiaId)
parent - the entity to querytopiaId - the id of the researched child entity.
null, if not found.Collection<E> getChilds(P parent)
parent - the entity to query.
int size(P parent)
parent - the entity to query
boolean isEmpty(P parent)
parent - the entity to query
true is the given parent has no child.
void setChilds(P parent,
Collection<E> childs)
parent - the entity to be settedchilds - the collection of childs to set.
void addToList(P parent,
E e)
throws TopiaException
parent - the entity to modifiye - the entity to add in parent.
TopiaException - if any db problem while operation
void removeFromList(P parent,
E e)
throws TopiaException
parent - the entity to modifiye - the child to remove.
TopiaException - if any pb while operation.void removeAll(P parent)
parent - the entity to modify
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||