Project

General

Profile

Download (1.67 KB) Statistics
| Branch: | Tag: | Revision:
1 78c2bf74 Katja Luther
/**
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 98ce4a92 Andreas Müller
*/
9 78c2bf74 Katja Luther
10 3a6c7a0d ben.clark
package eu.etaxonomy.cdm.api.service;
11
12
import java.util.List;
13
14
import org.apache.log4j.Logger;
15 c4e812bc ben.clark
import org.springframework.beans.factory.annotation.Autowired;
16 3a6c7a0d ben.clark
import org.springframework.stereotype.Service;
17
import org.springframework.transaction.annotation.Transactional;
18
19 79c0eaa0 Andreas Müller
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
20 3a6c7a0d ben.clark
import eu.etaxonomy.cdm.model.occurrence.Collection;
21
import eu.etaxonomy.cdm.persistence.dao.occurrence.ICollectionDao;
22 f197a589 Andreas Müller
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
23 3a6c7a0d ben.clark
24
@Service
25
@Transactional(readOnly = true)
26 98ce4a92 Andreas Müller
public class CollectionServiceImpl
27
            extends	IdentifiableServiceBase<Collection, ICollectionDao>
28
            implements	ICollectionService {
29
30 f260e5fd Andreas Müller
	@SuppressWarnings("unused")
31 3a6c7a0d ben.clark
	static private final Logger logger = Logger.getLogger(CollectionServiceImpl.class);
32
33 c4e812bc ben.clark
    @Autowired
34 3a6c7a0d ben.clark
	@Override
35
	protected void setDao(ICollectionDao dao) {
36
		this.dao = dao;
37
	}
38
39 f197a589 Andreas Müller
40 b17d9121 Andreas Müller
	@Override
41 4116e48b Andreas Müller
	@Transactional(readOnly = false)
42 57d5b579 Andreas Müller
    public void updateCaches(Class<? extends Collection> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) {
43 f197a589 Andreas Müller
		if (clazz == null){
44
			clazz = Collection.class;
45
		}
46 784fe709 Andreas Müller
		super.updateCachesImpl(clazz, stepSize, cacheStrategy, monitor);
47 3a6c7a0d ben.clark
	}
48 f197a589 Andreas Müller
49 98ce4a92 Andreas Müller
50
	@Override
51
    public List<Collection> searchByCode(String code) {
52 c4e812bc ben.clark
		return this.dao.getCollectionByCode(code);
53
	}
54 3a6c7a0d ben.clark
}