|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eu.etaxonomy.cdm.persistence.dao.AbstractBeanInitializer
public abstract class AbstractBeanInitializer
Field Summary | |
---|---|
static Logger |
logger
|
Fields inherited from interface eu.etaxonomy.cdm.persistence.dao.IBeanInitializer |
---|
LOAD_2ONE_2MANY_WILDCARD, LOAD_2ONE_WILDCARD |
Constructor Summary | |
---|---|
AbstractBeanInitializer()
|
Method Summary | ||
---|---|---|
Map<Class<? extends CdmBase>,AutoPropertyInitializer<CdmBase>> |
getBeanAutoInitializers()
|
|
static Set<PropertyDescriptor> |
getProperties(Object bean,
Set<Class> typeRestrictions)
Return all public bean properties which, exclusive those whose return type match any class defined in the parameter typeRestrictions or which are transient properties. |
|
void |
initialize(Object bean,
List<String> propertyPaths)
Allows more fine grained initialization not only of the root bean identified by its uuid but also of specific paths of
the object graph. |
|
|
initializeAll(C beanList,
List<String> propertyPaths)
Initializes the entities given in the bean list according to the given propertyPaths . |
|
void |
initializeBean(Object bean,
boolean cdmEntities,
boolean collections)
Initializes all *toOne relations of the given bean and all *toMany relations, depending on the state of the boolean parameters cdmEntities and collections |
|
abstract Object |
initializeInstance(Object proxy)
Initialize the the proxy, unwrap the target object and return it. |
|
void |
load(Object bean)
Initializes all *ToOne relations of the bean . |
|
void |
loadFully(Object bean)
Initializes all *ToOne and all *ToMany relations of the bean . |
|
void |
setBeanAutoInitializers(Map<Class<? extends CdmBase>,AutoPropertyInitializer<CdmBase>> beanAutoInitializers)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Logger logger
Constructor Detail |
---|
public AbstractBeanInitializer()
Method Detail |
---|
public void setBeanAutoInitializers(Map<Class<? extends CdmBase>,AutoPropertyInitializer<CdmBase>> beanAutoInitializers)
beanAutoInitializers
- the beanAutoInitializers to setpublic Map<Class<? extends CdmBase>,AutoPropertyInitializer<CdmBase>> getBeanAutoInitializers()
public abstract Object initializeInstance(Object proxy)
IBeanInitializer
initializeInstance
in interface IBeanInitializer
proxy
- the proxy to initialize may wrap a single bean or a collection
public void load(Object bean)
IBeanInitializer
bean
.
load
in interface IBeanInitializer
public void loadFully(Object bean)
IBeanInitializer
bean
.
loadFully
in interface IBeanInitializer
public void initializeBean(Object bean, boolean cdmEntities, boolean collections)
cdmEntities
and collections
bean
- the bean to initializecdmEntities
- initialize all *toOne relations to cdm entitiescollections
- initialize all *toMany relationspublic void initialize(Object bean, List<String> propertyPaths)
IBeanInitializer
uuid
but also of specific paths of
the object graph. The sub graph to initialize may be defined in the
propertyPaths
parameter as list of paths all starting at the
root bean.
You can use wildcards *
LOAD_2ONE_2MANY_WILDCARD
and $
LOAD_2ONE_WILDCARD
for initializing
all *ToOne and all *ToMany relations of a bean.
NOTE: A wildcard subsequently terminates its property path.
Example: Assuming cdmEntity
is a Taxon
instance the following propertyPaths
can be used for
initializing bean properties of this instance. It is possible to
initialized nested properties of properties with unlimited depth.
name
: initializes TaxonBase.getName()
name.rank
: initializes TaxonBase.getName()
.getRank()
name.$
: initializes all *ToOne relations of the TaxonBase.getName()
initialize
in interface IBeanInitializer
propertyPaths
- a List of property namespublic <C extends Collection<?>> C initializeAll(C beanList, List<String> propertyPaths)
IBeanInitializer
propertyPaths
.
initializeAll
in interface IBeanInitializer
public static Set<PropertyDescriptor> getProperties(Object bean, Set<Class> typeRestrictions)
typeRestrictions
or which are transient properties.
bean
- typeRestrictions
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |