|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.persistence.util.EntityOperator<B>
B - type de l'entitepublic class EntityOperator<B extends TopiaEntity>
Un objet qui permet d'effecuter des operations de manipulation des donnees
dans les entites du type donne.
L'objet connait la liste des proprietes et des associations du type donne et
permet de modifier ces valeurs :
get(String, TopiaEntity)
set(String, TopiaEntity,Object)
copy(String, TopiaEntity,TopiaEntity)
getChild(String, TopiaEntity, String)
addChild(String, TopiaEntity, Object)
removeChild(String, TopiaEntity, Object)
...
D'autres methodes permettent d'effectuer des operations en lot (sur plusieurs
proprietes en meme temps) sur les proprietes :
copyProperties(TopiaEntity, TopiaEntity, boolean, String[])
obtainProperties(TopiaEntity, String[])
clearProperties(TopiaEntity, String[])
Note : cet objet ne permet pas d'operation vers les bases.
| Field Summary | |
|---|---|
protected List<String> |
associationProperties
|
protected Method[] |
childAddAllMethods
|
protected Method[] |
childAddMethods
|
protected Method[] |
childClearMethods
|
protected Method[] |
childGetMethods
|
protected Method[] |
childIsEmptyMethods
|
protected Method[] |
childRemoveMethods
|
protected Method[] |
childSizeMethods
|
protected TopiaEntityEnum |
contract
|
protected Method[] |
getMethods
|
protected List<String> |
properties
|
protected Method[] |
setMethods
|
| Constructor Summary | |
|---|---|
protected |
EntityOperator(TopiaEntityEnum contract)
|
| Method Summary | ||
|---|---|---|
void |
addAllChild(String name,
B bean,
Collection<?> childs)
Ajoute toutes les entites d'association. |
|
void |
addChild(String name,
B bean,
Object child)
Ajoute une entite d'association. |
|
void |
clearChild(String name,
B bean)
Retire toutes les entites d'association. |
|
void |
clearProperties(B from,
String... properties)
Met a null toutes les proprietes donnees. |
|
Object |
clone()
|
|
void |
copy(String name,
B from,
B dst)
Copie une propriete de src vers dst. |
|
void |
copyProperties(B from,
B dst,
boolean tech,
String... properties)
Recopie toutes les proprietes donnes depuis src vers dst. |
|
boolean |
equals(Object obj)
|
|
protected void |
finalize()
|
|
Object |
get(String name,
B bean)
Recupere la valeur de la propriete donnee. |
|
List<String> |
getAssociationProperties()
|
|
protected Class<?> |
getAssociationPropertyType(int index)
|
|
Class<?> |
getAssociationPropertyType(String name)
|
|
Object |
getChild(String name,
B bean,
String topiaId)
Recupere une entite d'association a partir de son id. |
|
Class<B> |
getClazz()
|
|
List<String> |
getProperties()
|
|
protected Collection<String> |
getProperties(String[] properties)
|
|
protected Class<?> |
getPropertyType(int index)
|
|
Class<?> |
getPropertyType(String name)
|
|
int |
hashCode()
|
|
protected void |
init()
|
|
protected void |
init(Class<?> entityClass,
Set<Class<?>> explored,
List<String> properties,
List<String> associationProperties,
List<Method> getters,
List<Method> setters,
List<Method> childGetters,
List<Method> childAdders,
List<Method> childAddersAll,
List<Method> childRemovers,
List<Method> childSize,
List<Method> childClearers,
List<Method> childIsEmpty)
|
|
protected static void |
invoke(Method m,
Object bean,
Object... args)
|
|
protected static
|
invokeWithResult(Method m,
Object bean,
Object... args)
|
|
boolean |
isChildEmpty(String name,
B bean)
Test s'il existe des entites d'association pour la propriete donnee. |
|
protected B |
newInstance()
|
|
Map<String,Object> |
obtainProperties(B from,
String... properties)
Obtenir dans un dictionnaire, les valeurs des proprietes donnees. |
|
void |
removeChild(String name,
B bean,
Object child)
Retire une entite d'association. |
|
void |
set(String name,
B bean,
Object value)
Positionner la valeur donne de la propriete donnee. |
|
void |
setNull(String name,
B bean)
Positionner la valeur nulle de la propriete donnee. |
|
int |
sizeChild(String name,
B bean)
Retourne le nombre d'entite d'association. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final TopiaEntityEnum contract
protected List<String> properties
protected List<String> associationProperties
protected transient Method[] getMethods
protected transient Method[] setMethods
protected transient Method[] childGetMethods
protected transient Method[] childAddMethods
protected transient Method[] childAddAllMethods
protected transient Method[] childRemoveMethods
protected transient Method[] childSizeMethods
protected transient Method[] childIsEmptyMethods
protected transient Method[] childClearMethods
| Constructor Detail |
|---|
protected EntityOperator(TopiaEntityEnum contract)
| Method Detail |
|---|
public Object get(String name,
B bean)
getXXX().
name - le nom de la proprietebean - l'instance a interroger
public void set(String name,
B bean,
Object value)
setXXX(value).
name - le nom de la proprietebean - l'instance a mettre a jourvalue - la valeur a positionner
public void copy(String name,
B from,
B dst)
setXXX(value).
name - le nom de la proprietefrom - l'instance a interrogerdst - l'instance a mettre a jour
public void setNull(String name,
B bean)
setXXX(nullValue).
name - le nom de la proprietebean - l'instance a mettre a jour
public Object getChild(String name,
B bean,
String topiaId)
getXXXByTopiaId(topiaId).
name - le nom de la propriete d'associationbean - l'instance a interrogertopiaId - l'id de l'entite recherchee
public boolean isChildEmpty(String name,
B bean)
isXXXEmpty().
name - le nom de la propriete d'associationbean - l'instance a interroger
true si pas d'entite d'association
public void addChild(String name,
B bean,
Object child)
addXXX(child).
name - le nom de la propriete d'associationbean - l'instance a mettre a jourchild - l'entite a ajouter
public void addAllChild(String name,
B bean,
Collection<?> childs)
addXXX(child).
name - le nom de la propriete d'associationbean - l'instance a mettre a jourchilds - les entites a ajouter
public void removeChild(String name,
B bean,
Object child)
removeXXX(child).
name - le nom de la propriete d'associationbean - l'instance a mettre a jourchild - l'entite a retirer
public int sizeChild(String name,
B bean)
sizeXXX(childs).
name - le nom de la propriete d'associationbean - l'instance a mettre a jour
public void clearChild(String name,
B bean)
clearXXX(childs).
name - le nom de la propriete d'associationbean - l'instance a mettre a jour
public void copyProperties(B from,
B dst,
boolean tech,
String... properties)
from - l'entite a interrogerdst - l'entite a mettre a jourtech - un drapeau pour recopier aussi les infos techniquesproperties - les proprietes a recopier
public Map<String,Object> obtainProperties(B from,
String... properties)
from - l'object a scanneproperties - les proprietes a retenir (vide si on les veut toutes)
public void clearProperties(B from,
String... properties)
from - l'object a scanneproperties - les proprietes a retenir (vide si on les veut toutes)public List<String> getProperties()
public List<String> getAssociationProperties()
public Class<?> getPropertyType(String name)
public Class<?> getAssociationPropertyType(String name)
public Class<B> getClazz()
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Object
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic String toString()
toString in class Objectprotected Collection<String> getProperties(String[] properties)
protected Class<?> getPropertyType(int index)
protected Class<?> getAssociationPropertyType(int index)
protected B newInstance()
protected void init()
protected static void invoke(Method m,
Object bean,
Object... args)
protected static <V> V invokeWithResult(Method m,
Object bean,
Object... args)
protected void init(Class<?> entityClass,
Set<Class<?>> explored,
List<String> properties,
List<String> associationProperties,
List<Method> getters,
List<Method> setters,
List<Method> childGetters,
List<Method> childAdders,
List<Method> childAddersAll,
List<Method> childRemovers,
List<Method> childSize,
List<Method> childClearers,
List<Method> childIsEmpty)
throws IntrospectionException
IntrospectionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||