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 eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
14
|
|
15
|
/**
|
16
|
* <i>CURRENTLY UNUSED</i>
|
17
|
*
|
18
|
* @author a.kohlbecker
|
19
|
* @since 30.07.2010
|
20
|
*/
|
21
|
public class TaxonNodeAutoInitializer extends AutoPropertyInitializer<TaxonNode> {
|
22
|
|
23
|
@Override
|
24
|
public void initialize(TaxonNode bean) {
|
25
|
beanInitializer.initializeInstance(bean.getTaxon().getName());
|
26
|
beanInitializer.initializeInstance(bean.getTaxon().getSec());
|
27
|
beanInitializer.initializeInstance(bean.getTaxon().getSec().getSources());
|
28
|
}
|
29
|
|
30
|
@Override
|
31
|
public Optional<String> hibernateFetchJoin(Class<?> clazz, String beanAlias){
|
32
|
|
33
|
String result = "";
|
34
|
result += String.format(" LEFT JOIN FETCH %s.taxon taxon LEFT JOIN FETCH taxon.name LEFT JOIN FETCH taxon.secSource ss LEFT JOIN FETCH ss.citation ", beanAlias);
|
35
|
return Optional.of(result);
|
36
|
}
|
37
|
}
|