LookupManagerImpl.java
962 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.myproject.service.impl;
import com.myproject.dao.LookupDao;
import com.myproject.model.LabelValue;
import com.myproject.model.Role;
import com.myproject.service.LookupManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* Implementation of LookupManager interface to talk to the persistence layer.
*
* @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
*/
@Service("lookupManager")
public class LookupManagerImpl implements LookupManager {
@Autowired
LookupDao dao;
/**
* {@inheritDoc}
*/
public List<LabelValue> getAllRoles() {
List<Role> roles = dao.getRoles();
List<LabelValue> list = new ArrayList<LabelValue>();
for (Role role1 : roles) {
list.add(new LabelValue(role1.getName(), role1.getName()));
}
return list;
}
}