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