일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- jvm
- oracle
- DBCP
- 이클립스
- jeus
- SQL
- 자바
- HTML
- 디자이어
- Java
- Desire
- C34G55T
- SWFUpload
- javascript
- 초대장
- htc
- 모토로이
- mybatis
- HD2
- Spring
- 오라클
- 삼성 오디세이
- USB
- ant
- FTP
- jsp
- eclipse
- 구글
- 삼성 오디세이 G5 C34G55T
- tomcat
- Today
- Total
목록Spring & Maven & Mybatis (5)
앙되요
interface mapper.java String a = "select * from t_user_m where user_id = #{a}"; @Select(a) @ResultMap("test") List> insertUserFor() { Map map = new HashMap(); map.put("a", "admin"); return userMapper.insertUserFor(map); } mapper.xml 이렇게 한 이유 select 쿼리 중 중복되는 경우가 많을경우 빼서 쓰면 된다.
쿼리를 작성하다보면 파라미터를 여러개를 줄 경우가 있다. 쿼리를 작성하는 mapper.xml에서 여러개의 변수를 받아 해결해야하는데 예제를 봐도 여기 저기를 찾아봐도 하나만 쓰는 예제만 있지 여러개는 없다. 그래서 어떻게 해결해야하나 고민하다 발견!!! 고생했다 ㅜㅜ 자 Mapper interface 에서 저렇게 map으로 구성된 변수 2개를 넣어주고. public interface UserMapper { List> selectUser() { Map h = new HashMap(); h.put("a", "admin"); Map h2 = new HashMap(); h2.put("b", "admin2"); UserVO vo = new UserVO(); vo.setH(h); vo.setH2(h2); retur..
jboss6를 설치하기 전에 eclipse indigo에 jboss6 플러그인을 설치한다. 그후 기존에 톰켓으로 구동이 잘되던 기존 프로젝트를 구동한 결과 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [config/mybatis-context.xml]; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilde..
//리스트 @RequestMapping(value = "/desc", method = RequestMethod.GET) public String selectDescUser(@ModelAttribute("reqUserVO") UserVO reqUserVO, Model model) { List list = userService.selectDescUser(reqUserVO); model.addAttribute("user", list); return "test"; } @ModelAttribute jsp의 request parameter를 자동으로 매핑해주고 jsp에 그대로 값도 전해준다. 즉. model.addAttribute("reqUserVO", reqUserVO); 이걸 해준다는 뜻. request dat..