1
|
/**
|
2
|
* Copyright (C) 2007 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.Collection;
|
13
|
import java.util.List;
|
14
|
import java.util.Map;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
import org.apache.log4j.Logger;
|
18
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
import org.springframework.stereotype.Service;
|
20
|
import org.springframework.transaction.annotation.Transactional;
|
21
|
|
22
|
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
23
|
import eu.etaxonomy.cdm.persistence.dao.reference.IReferenceDao;
|
24
|
|
25
|
|
26
|
@Service
|
27
|
@Transactional(readOnly = true)
|
28
|
public class ReferenceServiceImpl extends IdentifiableServiceBase<ReferenceBase,IReferenceDao> implements IReferenceService {
|
29
|
|
30
|
static Logger logger = Logger.getLogger(ReferenceServiceImpl.class);
|
31
|
|
32
|
public ReferenceBase getReferenceByUuid(UUID uuid) {
|
33
|
return super.getCdmObjectByUuid(uuid);
|
34
|
}
|
35
|
|
36
|
public List<ReferenceBase> getReferencesByTitle(String title) {
|
37
|
return super.findCdmObjectsByTitle(title);
|
38
|
}
|
39
|
|
40
|
public List<ReferenceBase> getReferencesByTitle(String title, Class<ReferenceBase> clazz) {
|
41
|
return super.findCdmObjectsByTitle(title, clazz);
|
42
|
}
|
43
|
|
44
|
@Transactional(readOnly = false)
|
45
|
public UUID saveReference(ReferenceBase reference) {
|
46
|
return super.saveCdmObject(reference);
|
47
|
}
|
48
|
|
49
|
@Transactional(readOnly = false)
|
50
|
public Map<UUID, ReferenceBase> saveReferenceAll(Collection<ReferenceBase> referenceCollection){
|
51
|
return saveCdmObjectAll(referenceCollection);
|
52
|
}
|
53
|
|
54
|
public List<ReferenceBase> getAllReferences(int limit, int start){
|
55
|
return dao.list(limit, start);
|
56
|
}
|
57
|
|
58
|
|
59
|
public void generateTitleCache() {
|
60
|
logger.warn("Not yet implemented");
|
61
|
// TODO Auto-generated method stub
|
62
|
|
63
|
}
|
64
|
|
65
|
@Autowired
|
66
|
protected void setDao(IReferenceDao dao) {
|
67
|
this.dao = dao;
|
68
|
}
|
69
|
|
70
|
|
71
|
}
|