1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.persistence.dao.initializer;
|
11
|
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
15
|
|
16
|
/**
|
17
|
* @author a.kohlbecker
|
18
|
* @date 30.07.2010
|
19
|
*
|
20
|
*/
|
21
|
public abstract class AutoPropertyInitializer<T extends CdmBase> {
|
22
|
|
23
|
@Autowired
|
24
|
protected IBeanInitializer beanInitializer;
|
25
|
|
26
|
|
27
|
/**
|
28
|
* Implement this method to initialize associated entities of the supplied beans.
|
29
|
* <p>
|
30
|
* For initializing collections of cdm entity bean it is recommended to
|
31
|
* use {@link IBeanInitializer#initializeInstance(Object)}.<br>
|
32
|
* <b>WARNING</b>: You must NOT use {@link IBeanInitializer#initialize(Object, java.util.List)}
|
33
|
* or {@link IBeanInitializer#initializeAll(java.util.List, java.util.List)} otherwise you risk
|
34
|
* to get StackOverflowExceptions.
|
35
|
*
|
36
|
* @param bean the cdm entity bean to process
|
37
|
*/
|
38
|
public abstract void initialize(T bean);
|
39
|
|
40
|
|
41
|
public abstract String hibernateFetchJoin(Class<?> clazz, String beanAlias) throws Exception;
|
42
|
|
43
|
|
44
|
}
|