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.logging.log4j.LogManager;import org.apache.logging.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
|
27
|
extends IdentifiableServiceBase<Collection, ICollectionDao>
|
28
|
implements ICollectionService {
|
29
|
|
30
|
@SuppressWarnings("unused")
|
31
|
static private final Logger logger = LogManager.getLogger(CollectionServiceImpl.class);
|
32
|
|
33
|
@Autowired
|
34
|
@Override
|
35
|
protected void setDao(ICollectionDao dao) {
|
36
|
this.dao = dao;
|
37
|
}
|
38
|
|
39
|
|
40
|
@Override
|
41
|
@Transactional(readOnly = false)
|
42
|
public UpdateResult updateCaches(Class<? extends Collection> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) {
|
43
|
if (clazz == null){
|
44
|
clazz = Collection.class;
|
45
|
}
|
46
|
return super.updateCachesImpl(clazz, stepSize, cacheStrategy, monitor);
|
47
|
}
|
48
|
|
49
|
|
50
|
@Override
|
51
|
public List<Collection> searchByCode(String code) {
|
52
|
return this.dao.getCollectionByCode(code);
|
53
|
}
|
54
|
}
|