Project

General

Profile

Download (1.14 KB) Statistics
| Branch: | Tag: | Revision:
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 eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
12

    
13
/**
14
 * @author a.kohlbecker
15
 * @date 30.07.2010
16
 *
17
 * @TODO only necessary since Point is not subclass of CdmBase
18
 */
19
public class GatheringEventLocationAutoInitializer extends AutoPropertyInitializer<GatheringEvent> {
20

    
21
    @Override
22
    public void initialize(GatheringEvent bean) {
23
        try {
24
            beanInitializer.initializeInstance(bean.getExactLocation().getReferenceSystem().getRepresentations());
25
        } catch (NullPointerException npe){
26
            /* IGNORE */
27
        }
28
    }
29
    
30
    @Override
31
    public String hibernateFetchJoin(Class<?> clazz, String beanAlias) throws Exception{
32
    	return String.format(" LEFT JOIN FETCH %s.exactLocation l LEFT JOIN l.referenceSystem rs LEFT JOIN rs.representations ", beanAlias); 
33
    }
34

    
35
}
(6-6/13)