Project

General

Profile

Revision 7ec9b1d9

ID7ec9b1d9e274ad9f923b53e455b0473db51277bd
Parent 7c5a1cc8
Child fd8764da

Added by Katja Luther over 4 years ago

new method to get UuidAndTitleCache objects with nomenclatural
titleCache for teamOrPersonBase

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/agent/IAgentDao.java
105 105
	 * @return
106 106
	 */
107 107
	public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();
108

  
109
    /**
110
     * @param limit
111
     * @param pattern
112
     * @return
113
     */
114
    List<UuidAndTitleCache<AgentBase>> getUuidAndAbbrevTitleCache(Integer limit, String pattern);
108 115
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/agent/AgentDaoImpl.java
164 164
		return getUuidAndTitleCache(query);
165 165
	}
166 166

  
167

  
168
	@Override
169
    public List<UuidAndTitleCache<AgentBase>> getUuidAndAbbrevTitleCache(Integer limit, String pattern){
170
        Session session = getSession();
171
        Query query = null;
172
        if (pattern != null){
173
            query = session.createQuery("select uuid, id, nomenclaturalTitle from " + type.getSimpleName() +" where nomenclaturalTitle like :pattern");
174
            pattern = pattern + "%";
175
            query.setParameter("pattern", pattern);
176
        } else {
177
            query = session.createQuery("select uuid, id, nomenclaturalTitle from " + type.getSimpleName() );
178
        }
179
        if (limit != null){
180
           query.setMaxResults(limit);
181
        }
182
        return getUuidAndTitleCache(query);
183
    }
184

  
185

  
167 186
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/AgentServiceImpl.java
241 241
        return result;
242 242
	}
243 243

  
244
    /* (non-Javadoc)
245
     * @see eu.etaxonomy.cdm.api.service.IAgentService#getUuidAndAbbrevTitleCache()
246
     */
247
    @Override
248
    public List<UuidAndTitleCache<AgentBase>> getUuidAndAbbrevTitleCache() {
249
        return dao.getUuidAndAbbrevTitleCache(null, null);
250
    }
251

  
244 252
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java
108 108
	public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();
109 109

  
110 110

  
111
	/**
112
     * Returns a list of <code>UuidAndTitleCache</code> containing all {@link Institution} objects
113
     * with their respective NomenclaturalTitleCache
114
     *
115
     * @return a list of <code>UuidAndTitleCache</code> instances
116
     */
117
    public List<UuidAndTitleCache<AgentBase>> getUuidAndAbbrevTitleCache();
118

  
111 119
    /**
112 120
     * @param teamUuid
113 121
     * @return

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)