문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
wiki:spring:mybatis [2020/04/01 15:52] dhan |
wiki:spring:mybatis [2023/01/13 18:44] (현재) |
||
---|---|---|---|
줄 10: | 줄 10: | ||
===== mapper.xml 예시 ===== | ===== mapper.xml 예시 ===== | ||
SELECT 예시 | SELECT 예시 | ||
- | < | + | < |
<select id=" | <select id=" | ||
select * from tbl_board order by pos asc | select * from tbl_board order by pos asc | ||
줄 18: | 줄 18: | ||
UPDATE 예시 | UPDATE 예시 | ||
- | < | + | < |
<update id=" | <update id=" | ||
update tbl_board set count = count + 1 where seq = #{seq} | update tbl_board set count = count + 1 where seq = #{seq} | ||
줄 26: | 줄 26: | ||
DELETE 예시 | DELETE 예시 | ||
- | < | + | < |
<delete id=" | <delete id=" | ||
delete from tbl_board where seq=#{seq} and password=# | delete from tbl_board where seq=#{seq} and password=# | ||
줄 57: | 줄 57: | ||
</ | </ | ||
- | [[http:// | + | [[http:// |
+ | [[https:// | ||
- | [[https://taetaetae.github.io/2017/ | + | ===== 동적 쿼리 ===== |
+ | [[http://blog.naver.com/roropoly1/221184569655|myBatis parameterType=" | ||
+ | ===== 배치(Batch) 입력/ | ||
+ | [[https:// | ||
+ | [[https:// | ||
- | ===== Mybatis에서 | + | ===== choose ===== |
+ | [[https:// | ||
+ | |||
+ | ===== Null체크 (ibatis와 비교) ===== | ||
>Mybatis | >Mybatis | ||
<code xml> | <code xml> | ||
줄 76: | 줄 84: | ||
</ | </ | ||
</ | </ | ||
- | [[https:// | + | [[https:// |
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== ResultHandler ===== | ||
+ | [[https:// | ||
+ | |||
+ | ===== ResultType & ResultMap ===== | ||
+ | [[https:// | ||
+ | |||
+ | ===== Test ===== | ||
+ | [[https:// | ||
+ | [[https:// | ||
===== Tip ===== | ===== Tip ===== | ||
줄 96: | 줄 119: | ||
> maxWait - 풀에 사용 가능할 연결이 없을때 대기하는 최대 시간을 밀리초 단위로 나타냅니다. 이 대기시간후에도 사용 가능한 연결이 없으면 예외를 발생합니다. -1은 무한대기를 나타냅니다. 기본값은 -1입니다. | > maxWait - 풀에 사용 가능할 연결이 없을때 대기하는 최대 시간을 밀리초 단위로 나타냅니다. 이 대기시간후에도 사용 가능한 연결이 없으면 예외를 발생합니다. -1은 무한대기를 나타냅니다. 기본값은 -1입니다. | ||
- | ===== Trouble shooting | + | ===== Troubleshooting |
DAO에서 보낸 VO가 SQL에서 값이 사라져 버릴 경우 | DAO에서 보낸 VO가 SQL에서 값이 사라져 버릴 경우 | ||
> 긴장하지 말고 pom.xml에서 mybatis, mybatis-spring 버전 업데이트 하면 해결이 됩니다. | > 긴장하지 말고 pom.xml에서 mybatis, mybatis-spring 버전 업데이트 하면 해결이 됩니다. | ||
줄 106: | 줄 129: | ||
===== Ref ===== | ===== Ref ===== | ||
+ | * [[https:// | ||
* [[http:// | * [[http:// | ||
- | * [[출처: | + | * [[https://jsonobject.tistory.com/ |
{{tag> | {{tag> |