MCPcopy Index your code
hub / github.com/castello/spring_basic / CommentDaoImpl

Class CommentDaoImpl

ch4/CommentDaoImpl.java:11–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import java.util.*;
10
11@Repository
12public class CommentDaoImpl implements CommentDao {
13 @Autowired
14 private SqlSession session;
15 private static String namespace = "com.fastcampus.ch4.dao.CommentMapper.";
16
17 @Override
18 public int count(Integer bno) throws Exception {
19 return session.selectOne(namespace+"count", bno);
20 } // T selectOne(String statement)
21
22 @Override
23 public int deleteAll(Integer bno) {
24 return session.delete(namespace+"deleteAll", bno);
25 } // int delete(String statement)
26
27 @Override
28 public int delete(Integer cno, String commenter) throws Exception {
29 Map map = new HashMap();
30 map.put("cno", cno);
31 map.put("commenter", commenter);
32 return session.delete(namespace+"delete", map);
33 } // int delete(String statement, Object parameter)
34
35 @Override
36 public int insert(CommentDto dto) throws Exception {
37 return session.insert(namespace+"insert", dto);
38 } // int insert(String statement, Object parameter)
39
40 @Override
41 public List<CommentDto> selectAll(Integer bno) throws Exception {
42 return session.selectList(namespace+"selectAll", bno);
43 } // List<E> selectList(String statement)
44
45 @Override
46 public CommentDto select(Integer cno) throws Exception {
47 return session.selectOne(namespace + "select", cno);
48 } // T selectOne(String statement, Object parameter)
49
50 @Override
51 public int update(CommentDto dto) throws Exception {
52 return session.update(namespace+"update", dto);
53 } // int update(String statement, Object parameter)
54}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected