3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
;
12 import java
.util
.List
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
15 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
18 * @author a.kohlbecker
22 public interface BeanInitializer
{
25 * Wildcard for initializing all *ToOne relations of a <code>bean</code>.
27 public static final String LOAD_2ONE_WILDCARD
= "$";
30 * Wildcard for initializing all *ToOne and all *ToMany relations of a <code>bean</code>.
32 public static final String LOAD_2ONE_2MANY_WILDCARD
= "*";
35 * Initializes all *ToOne relations of the <code>bean</code>.
39 public void load(Object bean
);
42 * Initializes all *ToOne and all *ToMany relations of the <code>bean</code>.
46 public void loadFully(Object bean
);
49 * Allows more fine grained initialization not only of the root bean
50 * identified by its <code>uuid</code> but also of specific paths of
51 * the object graph. The sub graph to initialize may be defined in the
52 * <code>propertyPaths</code> parameter as list of paths all starting at the
55 * You can use wildcards <code>*</code> {@link LOAD_2ONE_2MANY_WILDCARD}
56 * and <code>$</code> {@link LOAD_2ONE_WILDCARD} for initializing
57 * all *ToOne and all *ToMany relations of a bean.
58 * NOTE: A wildcard subsequently terminates its property path.
60 * <b>Example:</b> Assuming <code>cdmEntity</code> is a {@link Taxon}
61 * instance the following <code>propertyPaths</code> can be used for
62 * initializing bean properties of this instance. It is possible to
63 * initialized nested properties of properties with unlimited depth.
65 * <li><code>name</code>: initializes {@link Taxon#getName()}</li>
66 * <li><code>name.rank</code>: initializes {@link Taxon#getName()}.{@link TaxonNameBase#getRank() getRank()}</li>
67 * <li><code>name.$</code>: initializes all *ToOne relations of the {@link Taxon#getName()}</li>
71 * @param propertyPaths
72 * a List of property names
74 public void initialize(Object bean
, List
<String
> propertyPaths
);
76 public void initializeAll(List list
, List
<String
> propertyPaths
);
80 public void loadBy(UUID uuid);
81 public void loadFullyByUuid(UUID uuid);*/