|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.persistence.util.EntityListUpdator<P,E>
P - type of parent of childsE - type of childpublic class EntityListUpdator<P extends TopiaEntity,E extends TopiaEntity>
A implementation of ListUpdator for TopiaEntity type.
| Field Summary | |
|---|---|
protected java.lang.reflect.Method |
addMethod
|
protected java.beans.PropertyDescriptor |
descriptor
|
protected java.lang.reflect.Method |
getMethod
|
protected java.lang.String |
propertyName
|
protected java.lang.reflect.Method |
removeMethod
|
| Constructor Summary | |
|---|---|
protected |
EntityListUpdator(java.lang.Class<P> parentClass,
java.lang.Class<E> childClass,
java.lang.String propertyName)
|
| Method Summary | ||
|---|---|---|
void |
addToList(P parent,
E bean)
Add a erntity to his parent |
|
E |
getChild(P parent,
java.lang.String topiaId)
Obtain a child from the entity given his id. |
|
java.util.Collection<E> |
getChilds(P parent)
Obtain the collection of childs from the entity. |
|
protected static void |
invoke(java.lang.reflect.Method m,
java.lang.Object bean,
java.lang.Object... args)
|
|
protected static
|
invokeWithResult(java.lang.reflect.Method m,
java.lang.Object bean,
java.lang.Object... args)
|
|
static
|
newEntityListUpdator(java.lang.Class<P> parentClass,
java.lang.Class<E> childClass,
java.lang.String propertyName)
|
|
void |
removeFromList(P parent,
E bean)
Remove from a prent entity a given child. |
|
void |
setChilds(P parent,
java.util.Collection<E> childs)
Set the childs of an entity |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String propertyName
protected java.beans.PropertyDescriptor descriptor
protected java.lang.reflect.Method getMethod
protected java.lang.reflect.Method addMethod
protected java.lang.reflect.Method removeMethod
| Constructor Detail |
|---|
protected EntityListUpdator(java.lang.Class<P> parentClass,
java.lang.Class<E> childClass,
java.lang.String propertyName)
| Method Detail |
|---|
public static <P extends TopiaEntity,E extends TopiaEntity> EntityListUpdator<P,E> newEntityListUpdator(java.lang.Class<P> parentClass,
java.lang.Class<E> childClass,
java.lang.String propertyName)
public E getChild(P parent,
java.lang.String topiaId)
ListUpdator
getChild in interface ListUpdator<P extends TopiaEntity,E extends TopiaEntity>parent - the entity to querytopiaId - the id of the researched child entity.
null, if not found.public java.util.Collection<E> getChilds(P parent)
ListUpdator
getChilds in interface ListUpdator<P extends TopiaEntity,E extends TopiaEntity>parent - the entity to query.
public void setChilds(P parent,
java.util.Collection<E> childs)
ListUpdator
setChilds in interface ListUpdator<P extends TopiaEntity,E extends TopiaEntity>parent - the entity to be settedchilds - the collection of childs to set.
public void addToList(P parent,
E bean)
throws TopiaException
ListUpdator
addToList in interface ListUpdator<P extends TopiaEntity,E extends TopiaEntity>parent - the parent entitybean - the entity to add in parent.
TopiaException - if any db problem while operation
public void removeFromList(P parent,
E bean)
throws TopiaException
ListUpdator
removeFromList in interface ListUpdator<P extends TopiaEntity,E extends TopiaEntity>parent - the parent entitybean - the child to remove.
TopiaException - if any pb while operation.
protected static void invoke(java.lang.reflect.Method m,
java.lang.Object bean,
java.lang.Object... args)
protected static <V> V invokeWithResult(java.lang.reflect.Method m,
java.lang.Object bean,
java.lang.Object... args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||