1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.api.service;
|
12
|
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.List;
|
15
|
|
16
|
import org.apache.log4j.Logger;
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
18
|
import org.springframework.stereotype.Service;
|
19
|
import org.springframework.transaction.annotation.Transactional;
|
20
|
|
21
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
|
22
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
|
23
|
import eu.etaxonomy.cdm.persistence.dao.common.IPreferenceDao;
|
24
|
|
25
|
/**
|
26
|
* @author a.mueller
|
27
|
* @created 2013-09-09
|
28
|
*/
|
29
|
@Service
|
30
|
@Transactional(readOnly = true)
|
31
|
public class PreferenceServiceImpl implements IPreferenceService {
|
32
|
@SuppressWarnings("unused")
|
33
|
private static final Logger logger = Logger.getLogger(PreferenceServiceImpl.class);
|
34
|
|
35
|
@Autowired
|
36
|
private IPreferenceDao dao;
|
37
|
|
38
|
@Override
|
39
|
public CdmPreference get(PrefKey key) {
|
40
|
List<PrefKey> keys = new ArrayList<CdmPreference.PrefKey>(){};
|
41
|
keys.add(key);
|
42
|
// while(key.) TODO
|
43
|
|
44
|
return dao.get(key);
|
45
|
}
|
46
|
|
47
|
@Override
|
48
|
public void set(CdmPreference preference) {
|
49
|
dao.set(preference);
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
public int count() {
|
54
|
return dao.count();
|
55
|
}
|
56
|
|
57
|
|
58
|
}
|