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