Project

General

Profile

Revision 66196e09

ID66196e0922ed4bd48095c24c5f981e3b1872768d
Parent a97595f0
Child 94e0cd23

Added by Anahit Babadshanjan almost 13 years ago

Search for specific references implemented (getReferencesByTitle)

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IIdentifiableDao.java
9 9

  
10 10
package eu.etaxonomy.cdm.persistence.dao.common;
11 11

  
12
import java.util.List;
13

  
12 14
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
13 15

  
14 16
public interface IIdentifiableDao <T extends IdentifiableEntity> extends ICdmEntityDao<T>, ITitledDao<T>{
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/ITitledDao.java
49 49
	 */
50 50
	public List<T> findByTitle(String queryString, CdmBase sessionObject);
51 51
	
52
	public List<T> findByTitleAndClass(String queryString, Class<T> clazz);
53
	
52 54
	/**
53 55
	 * @param queryString
54 56
	 * @param matchAnywhere
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java
62 62

  
63 63
	}
64 64

  
65
	public List<DefinedTermBase> findByTitleAndClass(String queryString, Class<DefinedTermBase> clazz) {
66
		Session session = getSession();
67
		Criteria crit = session.createCriteria(clazz);
68
		crit.add(Restrictions.ilike("persistentTitleCache", queryString));
69
		List<DefinedTermBase> results = crit.list();
70
		return results;
71
	}
72
	
65 73
	/* (non-Javadoc)
66 74
	 * @see eu.etaxonomy.cdm.persistence.dao.common.ITitledDao#findByTitle(java.lang.String, eu.etaxonomy.cdm.persistence.dao.common.ITitledDao.MATCH_MODE, int, int, java.util.List)
67 75
	 */
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/IdentifiableDaoBase.java
53 53
		return results;
54 54
	}
55 55
	
56
	public List<T> findByTitleAndClass(String queryString, Class<T> clazz) {
57
		Session session = getSession();
58
		Criteria crit = session.createCriteria(clazz);
59
		crit.add(Restrictions.ilike("persistentTitleCache", queryString));
60
		List<T> results = crit.list();
61
		return results;
62
	}
56 63
	
57 64

  
58 65
	/* (non-Javadoc)

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)