Project

General

Profile

Download (1.31 KB) Statistics
| Branch: | Tag: | Revision:
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.common;
11

    
12
import java.util.List;
13
import java.util.UUID;
14

    
15
import org.apache.log4j.Logger;
16
import org.hibernate.Criteria;
17
import org.hibernate.criterion.Order;
18
import org.hibernate.criterion.Restrictions;
19
import org.springframework.dao.DataAccessException;
20
import org.springframework.stereotype.Repository;
21
import org.springframework.transaction.annotation.Transactional;
22

    
23
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
24
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
25
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
26

    
27

    
28
public class IdentifiableDaoBase<T extends IdentifiableEntity> extends CdmEntityDaoBase<T> implements IIdentifiableDao<T>{
29
	static Logger logger = Logger.getLogger(IdentifiableDaoBase.class);
30

    
31

    
32
	public IdentifiableDaoBase(Class<T> type) {
33
		super(type);
34
	}
35

    
36
	public List<T> findByTitle(String queryString) {
37
		Criteria crit = getSession().createCriteria(type);
38
		crit.add(Restrictions.ilike("titleCache", queryString));
39
		List<T> results = crit.list();
40
		return results;
41
	}
42
	
43

    
44
}
(6-6/7)