Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- mybatis
- DBCP
- 디자이어
- tomcat
- 삼성 오디세이
- SWFUpload
- C34G55T
- Desire
- Java
- oracle
- 자바
- javascript
- htc
- SQL
- 삼성 오디세이 G5 C34G55T
- 이클립스
- jvm
- Spring
- HTML
- jeus
- eclipse
- 모토로이
- ant
- HD2
- FTP
- 구글
- 오라클
- USB
- 초대장
- jsp
Archives
- Today
- Total
목록mybatis (3)
앙되요
[mybaits] mapper.xml 말고 그냥 mapper interface에 쿼리 넣기
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 쿼리 중 중복되는 경우가 많을경우 빼서 쓰면 된다.
Spring & Maven & Mybatis
2011. 12. 27. 17:50
[mybatis] mapper.xml에서 parameterType 여러개(2개 이상) 주는 방법
쿼리를 작성하다보면 파라미터를 여러개를 줄 경우가 있다. 쿼리를 작성하는 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..
Spring & Maven & Mybatis
2011. 12. 27. 11:24