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 | 31 |
Tags
- jvm
- Spring
- SWFUpload
- 디자이어
- 초대장
- DBCP
- SQL
- FTP
- tomcat
- 자바
- ant
- mybatis
- oracle
- 이클립스
- HD2
- Java
- 구글
- C34G55T
- 삼성 오디세이 G5 C34G55T
- 삼성 오디세이
- Desire
- htc
- jeus
- 오라클
- HTML
- javascript
- USB
- eclipse
- jsp
- 모토로이
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 쿼리 중 중복되는 경우가 많을경우 빼서 쓰면 된다.