Merge branch 'hotfix/3.12.3' into develop
[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.monitor.IProgressMonitor;
20 import eu.etaxonomy.cdm.model.occurrence.Collection;
21 import eu.etaxonomy.cdm.persistence.dao.occurrence.ICollectionDao;
22 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
23
24 @Service
25 @Transactional(readOnly = true)
26 public class CollectionServiceImpl extends IdentifiableServiceBase<Collection, ICollectionDao> implements ICollectionService {
27
28 @SuppressWarnings("unused")
29 static private final Logger logger = Logger.getLogger(CollectionServiceImpl.class);
30
31 @Autowired
32 @Override
33 protected void setDao(ICollectionDao dao) {
34 this.dao = dao;
35 }
36
37
38 @Override
39 @Transactional(readOnly = false)
40 public void updateTitleCache(Class<? extends Collection> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) {
41 if (clazz == null){
42 clazz = Collection.class;
43 }
44 super.updateTitleCacheImpl(clazz, stepSize, cacheStrategy, monitor);
45 }
46
47
48
49 public List<Collection> searchByCode(String code) {
50 return this.dao.getCollectionByCode(code);
51 }
52 }