Skip to content

Commit 5668632

Browse files
committed
added user service impl class
1 parent e2b20e6 commit 5668632

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.user.business.service;
2+
3+
import java.util.Collection;
4+
import com.user.business.data.UserDao;
5+
import com.user.business.data.UserDaoImpl;
6+
import com.user.business.domain.User;
7+
import java.util.Iterator;
8+
9+
public class UserServiceImpl implements UserService {
10+
11+
public Collection findAll() {
12+
UserDao userData = new UserDaoImpl();
13+
Collection users = userData.findAll(UserDao.ALL_BEER);
14+
for (Iterator it=users.iterator(); it.hasNext(); ) {
15+
User user = (User)it.next();
16+
System.out.println("user.getName()=" + user.getName() + "user.getBrewer()=" + user.getBrewer());
17+
}
18+
return users;
19+
}
20+
21+
public Collection findAllStates() {
22+
UserDao userData = new UserDaoImpl();
23+
Collection states = userData.findAllStates(UserDao.ALL_STATES);
24+
return states;
25+
}
26+
27+
28+
public int create(User user) {
29+
UserDao userData = new UserDaoImpl();
30+
userData.create(UserDao.CREATE_BEER, user);
31+
return 0;
32+
}
33+
34+
public void runThisBranch() {
35+
System.out.println("test");
36+
}
37+
38+
}

0 commit comments

Comments
 (0)