bugfix for DescriptionDaoImpl.getDescriptionElementForTaxon (missing implementation...
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / CollectionServiceImpl.java
1 /**
2 * Copyright (C) 2009 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.api.service;
11
12 import java.util.List;
13
14 import org.apache.log4j.Logger;
15 import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.stereotype.Service;
17 import org.springframework.transaction.annotation.Transactional;
18
19 import eu.etaxonomy.cdm.common.IProgressMonitor;
20 import eu.etaxonomy.cdm.model.common.TermVocabulary;
21 import eu.etaxonomy.cdm.model.occurrence.Collection;
22 import eu.etaxonomy.cdm.model.taxon.Classification;
23 import eu.etaxonomy.cdm.persistence.dao.occurrence.ICollectionDao;
24 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
25
26 @Service
27 @Transactional(readOnly = true)
28 public class CollectionServiceImpl extends IdentifiableServiceBase<Collection, ICollectionDao> implements ICollectionService {
29
30 static private final Logger logger = Logger.getLogger(CollectionServiceImpl.class);
31
32 @Autowired
33 @Override
34 protected void setDao(ICollectionDao dao) {
35 this.dao = dao;
36 }
37
38
39
40 /* (non-Javadoc)
41 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy)
42 */
43 @Override
44 public void updateTitleCache(Class<? extends Collection> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) {
45 if (clazz == null){
46 clazz = Collection.class;
47 }
48 super.updateTitleCacheImpl(clazz, stepSize, cacheStrategy, monitor);
49 }
50
51
52
53 public List<Collection> searchByCode(String code) {
54 return this.dao.getCollectionByCode(code);
55 }
56 }