1
|
/**
|
2
|
* Copyright (C) 2007 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
|
*/
|
10
|
package eu.etaxonomy.cdm.persistence.dao.hibernate.name;
|
11
|
|
12
|
import java.util.List;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
import org.hibernate.Criteria;
|
16
|
import org.springframework.stereotype.Repository;
|
17
|
|
18
|
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
|
19
|
import eu.etaxonomy.cdm.persistence.dao.hibernate.common.ReferencedEntityDaoImpl;
|
20
|
import eu.etaxonomy.cdm.persistence.dao.name.ITypeDesignationDao;
|
21
|
|
22
|
/**
|
23
|
* @author a.mueller
|
24
|
*
|
25
|
*/
|
26
|
@Repository
|
27
|
public class TypeDesignationDaoHibernateImpl<T extends TypeDesignationBase>
|
28
|
extends ReferencedEntityDaoImpl<TypeDesignationBase> implements ITypeDesignationDao {
|
29
|
@SuppressWarnings("unused")
|
30
|
private static final Logger logger = Logger.getLogger(TypeDesignationDaoHibernateImpl.class);
|
31
|
|
32
|
public TypeDesignationDaoHibernateImpl() {
|
33
|
super(TypeDesignationBase.class);
|
34
|
}
|
35
|
|
36
|
//TODO limit start
|
37
|
@Override
|
38
|
public List<TypeDesignationBase> getAllTypeDesignations(Integer limit, Integer start) {
|
39
|
Criteria crit = getSession().createCriteria(TypeDesignationBase.class);
|
40
|
if(limit != null){
|
41
|
crit.setMaxResults(limit);
|
42
|
}
|
43
|
if(start != null){
|
44
|
crit.setFirstResult(start);
|
45
|
}
|
46
|
List<TypeDesignationBase> results = crit.list();
|
47
|
return results;
|
48
|
}
|
49
|
|
50
|
}
|