2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.cdm
.persistence
.dao
.initializer
;
11 import java
.util
.Optional
;
13 import eu
.etaxonomy
.cdm
.model
.occurrence
.GatheringEvent
;
16 * @author a.kohlbecker
19 * @TODO only necessary since Point is not subclass of CdmBase
21 public class GatheringEventLocationAutoInitializer
extends AutoPropertyInitializer
<GatheringEvent
> {
24 public void initialize(GatheringEvent bean
) {
26 beanInitializer
.initializeInstance(bean
.getExactLocation().getReferenceSystem().getRepresentations());
27 } catch (NullPointerException npe
){
33 public Optional
<String
> hibernateFetchJoin(Class
<?
> clazz
, String beanAlias
){
34 return Optional
.of(String
.format(" LEFT JOIN FETCH %s.exactLocation l LEFT JOIN l.referenceSystem rs LEFT JOIN rs.representations ", beanAlias
));