Project

General

Profile

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

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

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

    
36
}
(6-6/12)