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

Class BoardDaoImpl

ch4/BoardDaoImpl.java:10–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import java.util.*;
9
10@Repository
11public class BoardDaoImpl implements BoardDao {
12 @Autowired
13 private SqlSession session;
14 private static String namespace = "com.fastcampus.ch4.dao.BoardMapper.";
15
16 public int count() throws Exception {
17 return session.selectOne(namespace+"count");
18 } // T selectOne(String statement)
19
20 @Override
21 public int deleteAll() {
22 return session.delete(namespace+"deleteAll");
23 } // int delete(String statement)
24
25 @Override
26 public int delete(Integer bno, String writer) throws Exception {
27 Map map = new HashMap();
28 map.put("bno", bno);
29 map.put("writer", writer);
30 return session.delete(namespace+"delete", map);
31 } // int delete(String statement, Object parameter)
32
33 public int insert(BoardDto dto) throws Exception {
34 return session.insert(namespace+"insert", dto);
35 } // int insert(String statement, Object parameter)
36
37 @Override
38 public List<BoardDto> selectAll() throws Exception {
39 return session.selectList(namespace+"selectAll");
40 } // List<E> selectList(String statement)
41
42 public BoardDto select(Integer bno) throws Exception {
43 return session.selectOne(namespace + "select", bno);
44 } // T selectOne(String statement, Object parameter)
45
46 @Override
47 public List<BoardDto> selectPage(Map map) throws Exception {
48 return session.selectList(namespace+"selectPage", map);
49 } // List<E> selectList(String statement, Object parameter)
50
51 @Override
52 public int update(BoardDto dto) throws Exception {
53 return session.update(namespace+"update", dto);
54 } // int update(String statement, Object parameter)
55
56 @Override
57 public int increaseViewCnt(Integer bno) throws Exception {
58 return session.update(namespace+"increaseViewCnt", bno);
59 } // int update(String statement, Object parameter)
60
61 @Override
62 public int searchResultCnt(SearchCondition sc) throws Exception {
63 System.out.println("sc in searchResultCnt() = " + sc);
64 System.out.println("session = " + session);
65 return session.selectOne(namespace+"searchResultCnt", sc);
66 } // T selectOne(String statement, Object parameter)
67

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected