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 | 29 | 30 |
Tags
- 모토로이
- mybatis
- HD2
- 이클립스
- jsp
- 삼성 오디세이
- oracle
- FTP
- DBCP
- javascript
- 구글
- SWFUpload
- 삼성 오디세이 G5 C34G55T
- SQL
- 오라클
- jeus
- HTML
- 자바
- Desire
- 디자이어
- jvm
- tomcat
- Spring
- USB
- Java
- 초대장
- ant
- htc
- eclipse
- C34G55T
Archives
- Today
- Total
앙되요
[mybaits] mapper.xml 말고 그냥 mapper interface에 쿼리 넣기 본문
interface mapper.java
String a = "select * from t_user_m where user_id = #{a}";
@Select(a)
String a = "select * from t_user_m where user_id = #{a}";
@Select(a)
@ResultMap("test")
List<HashMap<?,?>> insertUserFor(Map<String, String> h);
service
service
public List<HashMap<?, ?>> insertUserFor() {
Map<String, String> map = new HashMap<String, String>();
map.put("a", "admin");
return userMapper.insertUserFor(map);
}
mapper.xml
<resultMap id="test" type="hashmap"/>
이렇게 한 이유 select 쿼리 중 중복되는 경우가 많을경우 빼서 쓰면 된다.
mapper.xml
<resultMap id="test" type="hashmap"/>
이렇게 한 이유 select 쿼리 중 중복되는 경우가 많을경우 빼서 쓰면 된다.