Project

General

Profile

Download (1.39 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.cdm.api.service;
2

    
3
import org.apache.log4j.Logger;
4
import org.springframework.beans.factory.annotation.Autowired;
5
import org.springframework.stereotype.Service;
6
import org.springframework.transaction.annotation.Transactional;
7

    
8
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
9
import eu.etaxonomy.cdm.model.taxon.Taxon;
10
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
11
import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;
12

    
13
import java.util.List;
14
import java.util.UUID;
15

    
16

    
17
@Service
18
@Transactional(readOnly = true)
19
public class TaxonServiceImpl extends ServiceBase<TaxonBase> implements ITaxonService {
20
	static Logger logger = Logger.getLogger(TaxonServiceImpl.class);
21
	
22
	private ITaxonDao taxonDao;
23
	
24
	@Autowired
25
	protected void setDao(ITaxonDao dao) {
26
		this.dao = dao;
27
		this.taxonDao = dao;
28
	}
29
	
30

    
31
	public TaxonBase getTaxonByUuid(UUID uuid) {
32
		return super.getCdmObjectByUuid(uuid); 
33
	}
34

    
35
	@Transactional(readOnly = false)
36
	public UUID saveTaxon(TaxonBase taxon) {
37
		return super.saveCdmObject(taxon);
38
	}
39
	
40

    
41
	@Transactional(readOnly = false)
42
	public UUID removeTaxon(TaxonBase taxon) {
43
		return super.removeCdmObject(taxon);
44
	}
45

    
46
	public List<TaxonBase> searchTaxaByName(String name, ReferenceBase sec) {
47
		return taxonDao.getTaxaByName(name, sec);
48
	}
49

    
50
	public List<Taxon> getRootTaxa(ReferenceBase sec) {
51
		return taxonDao.getRootTaxa(sec);
52
	}
53
}
(15-15/16)