Project

General

Profile

« Previous | Next » 

Revision c51ef083

Added by Katja Luther almost 8 years ago

add limit and pattern to the uuid and titlecache methods

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/reference/ReferenceDaoHibernateImpl.java
94 94
	}
95 95

  
96 96
	@Override
97
	public List<UuidAndTitleCache<Reference>> getUuidAndTitleCache() {
97
	public List<UuidAndTitleCache<Reference>> getUuidAndTitleCache(Integer limit, String pattern) {
98 98
		List<UuidAndTitleCache<Reference>> list = new ArrayList<UuidAndTitleCache<Reference>>();
99 99
		Session session = getSession();
100 100

  
101 101
		Query query = session.createQuery("SELECT " +
102 102
				"r.uuid, r.id, r.titleCache, ab.titleCache FROM " + type.getSimpleName() + " AS r LEFT OUTER JOIN r.authorship AS ab ");//"select uuid, titleCache from " + type.getSimpleName());
103
		if (limit != null){
104
		    query.setMaxResults(limit);
105
		}
103 106

  
104 107
		@SuppressWarnings("unchecked")
105 108
        List<Object[]> result = query.list();

Also available in: Unified diff