eu.etaxonomy.cdm.persistence.dao
Interface IBeanInitializer

All Known Implementing Classes:
AbstractBeanInitializer, HibernateBeanInitializer

public interface IBeanInitializer

Author:
a.kohlbecker

Field Summary
static String LOAD_2ONE_2MANY_WILDCARD
          Wildcard for initializing all *ToOne and all *ToMany relations of a bean.
static String LOAD_2ONE_WILDCARD
          Wildcard for initializing all *ToOne relations of a bean.
 
Method Summary
 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.
<C extends Collection<?>>
C
initializeAll(C list, List<String> propertyPaths)
          Initializes the entities given in the bean list according to the given propertyPaths.
 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.
 

Field Detail

LOAD_2ONE_WILDCARD

static final String LOAD_2ONE_WILDCARD
Wildcard for initializing all *ToOne relations of a bean.

See Also:
Constant Field Values

LOAD_2ONE_2MANY_WILDCARD

static final String LOAD_2ONE_2MANY_WILDCARD
Wildcard for initializing all *ToOne and all *ToMany relations of a bean.

See Also:
Constant Field Values
Method Detail

load

void load(Object bean)
Initializes all *ToOne relations of the bean.

Parameters:
bean -

loadFully

void loadFully(Object bean)
Initializes all *ToOne and all *ToMany relations of the bean.

Parameters:
bean -

initialize

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. 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.

Parameters:
bean -
propertyPaths - a List of property names

initializeAll

<C extends Collection<?>> C initializeAll(C list,
                                          List<String> propertyPaths)
Initializes the entities given in the bean list according to the given propertyPaths.

Parameters:
beanList -
propertyPaths -
Returns:

initializeInstance

Object initializeInstance(Object proxy)
Initialize the the proxy, unwrap the target object and return it.

Parameters:
proxy - the proxy to initialize may wrap a single bean or a collection
Returns:
the unwrapped target object


Copyright © 2007-2013 EDIT. All Rights Reserved.