1
|
package eu.dnetlib.goldoa.service;
|
2
|
|
3
|
import eu.dnetlib.goldoa.domain.Help;
|
4
|
import eu.dnetlib.goldoa.service.dao.HelpDAO;
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
import org.springframework.dao.EmptyResultDataAccessException;
|
7
|
|
8
|
import java.util.List;
|
9
|
|
10
|
/**
|
11
|
* Created by antleb on 4/17/15.
|
12
|
*/
|
13
|
public class HelpManagerImpl implements HelpManager {
|
14
|
|
15
|
@Autowired
|
16
|
private HelpDAO helpDAO;
|
17
|
|
18
|
@Override
|
19
|
public Help saveHelp(Help help) {
|
20
|
return helpDAO.saveHelp(help);
|
21
|
}
|
22
|
|
23
|
@Override
|
24
|
public Help getById(String id) {
|
25
|
try {
|
26
|
return helpDAO.getById(id);
|
27
|
} catch (EmptyResultDataAccessException e) {
|
28
|
return null;
|
29
|
}
|
30
|
}
|
31
|
|
32
|
@Override
|
33
|
public List<Help> getAll() {
|
34
|
return helpDAO.getAll();
|
35
|
}
|
36
|
|
37
|
@Override
|
38
|
public void delete(String helpId) {
|
39
|
helpDAO.delete(helpId);
|
40
|
}
|
41
|
}
|