Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SpringBoot+MyBatisで例外が出たときどこを見るか
Search
syukai
March 27, 2024
Programming
0
270
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
March 27, 2024
Tweet
Share
More Decks by syukai
See All by syukai
ブランチ運用とデプロイフローを見直してリリースを楽にする
syukai
4
900
ノート付き-ブランチ運用とデプロイフローを見直してリリースを楽にする
syukai
0
65
TypeScriptとテストをはじめた
syukai
0
1k
一歩ずつ進めるVue.js
syukai
2
390
kanjava20170326
syukai
0
560
Other Decks in Programming
See All in Programming
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
良いユニットテストを書こう
mototakatsu
7
2.2k
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
Security_for_introducing_eBPF
kentatada
0
110
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
220
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
770
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
5
1.2k
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
770
선언형 UI에서의 상태관리
l2hyunwoo
0
160
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Building an army of robots
kneath
302
44k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
A better future with KSS
kneath
238
17k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
4QSJOH .Z#BUJTͰ ྫ֎͕ग़ͨͱ͖Ͳ͜ΛݟΔ͔ ؔδϟό`݄ ϢΧΠ
ϢΧΠ !TZVLBJ &$αΠτ։ൃӡ༻νʔϜͷ&. +BWBΛத৺ʹஔ͖ͭͭ։ൃʹؔ͢ΔͳΜͰΔ ʢϑϩϯτΤϯυ͔ΒڑΛஔ͍͍ͯΔʣ ࣗݾհ 2
ࠓͷΰʔϧ w .Z#BUJTͷΤϥʔݟͯύχΫΒͳ͍
.Z#BUJTͱʁ IUUQTNZCBUJTPSHNZCBUJTKBJOEFYIUNM
ࡶͳઆ໌ 9.-ϑΝΠϧʹॻ͍ͨ42-Λ࣮ߦͯ͘͠ΕΔπʔϧ ʢͱ͍͏͍ํΛ͢ΔఆͰࠓ͠·͢ʣ
ͱ͍͏ཧղͩͱྫ֎ग़ͨͱ͖ʹʮ42-࣮ߦ͍͚ͨͩ͠ͳͷʹʂʯͱͳΔ ݴ͍͑Δͱ ʮ42-Λ࣮ߦ͢ΔͨΊʹඞཁͳz͋Ε͜Εzͬͯ͘ΕΔศརͳͭʯ ˠz͋Ε͜Εz͕ͲΜͳ͜ͱͳͷ͔͓ͬͯ͘͜ͱ͕େࣄ ˠ͜ͷล͕ؒҧ͑ͯͨΒ͜Μͳྫ֎͕ग़Δɺ͕Θ͔Δ ɹυΩϡϝϯτͪΐͬͱಡΈ͘͢ͳΔͣʢͨͿΜɻ͠ΒΜ͚Ͳʣ
େ·͔ͳॲཧͷྲྀΕ
ʢલఏʣࠓճఆͷڥ w +BWB w 4QSJOH#PPU w )%BUBCBTF w (SBEMF ˞ڥҎ֎ʹҧ͏͍ํɾॻ͖ํͰ͖·͕͢ɺ
ɹҰྫͱͯ͠ࢀߟʹ͍ͯͩ͘͠͞ɻ
αϯϓϧ ݺͼग़͠Օॴ demoMapper.get(); %FNP.BQQFSKBWB @Mapper public interface DemoMapper { List<Demo>
get();_ } %FNP.BQQFSYNM <select id="get"> SELECT * FROM demo </select> (JU)VCIUUQTHJUIVCDPNTZVLBJNZCBUJTFSSPSMFBSOJOHXJUITQSJOHCPPU
ͬͯ͘ΕΔ͜ͱ ʢΞϓϦىಈ࣌ʣ9.-Λϩʔυ .BQϑΝΠϧΛ୳͢ ύϥϝλ͢ɺΓͷϚοϐϯά 42-Λ४උ͢Δ QSFQBSF
42-Λ࣮ߦͯ͠%#͔Β݁ՌΛड͚औΔ ΦϒδΣΫτʹΛೖ ͦΕͧΕͷॲཧͰΤϥʔ͕ൃੜ͠͏Δ ίϯύΠϧΤϥʔʹͳΒͳ͍
9.-ϑΝΠϧΛϩʔυ w ىಈ࣌ʹ.Z#BUJT༻ʹ༻ҙͨ͠9.-ϑΝΠϧΛϩʔυ͢Δ w 9.-ΛಡΈࠐΜͰඞཁͳΫϥεͱ͔ϩʔυͯ͠Δʁ
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w PSHBQBDIFJCBUJTCVJMEFS#VJMEFS&YDFQUJPOʢىಈ࣌ʹൃੜʣ w 9.-ͷจ๏͕ؒҧ͑ͯΔ w 3FTVMU.BQͳͲʹࢦఆͨ͠Ϋϥε͕ؒҧ͑ͯΔʢଘࡏ͠ͳ͍ʣ
.BQϑΝΠϧΛ୳͢ w .BQQFSΠϯλϑΣʔεʹରԠ͢ΔYNMϑΝΠϧΛ୳͢ w σϑΥϧτͰSFTPVSDFTԼͷ.BQQFSͱಉ͡ύε w .BQQFS͕TSDNBJODPNFYBNQMFEFNP.BQQFSͳΒ SFTPVSDFNBJODPNFYBNQMFEFNP.BQQFSYNM w
.BWFO(SBEMFͰSFTPVSDFTͷରΛઃఆ͢Δ͜ͱͰNBJOԼʹஔ͍ ͯಡΈࠐ·ΕΔΑ͏ʹมߋͰ͖Δ
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w PSHBQBDIFJCBUJTCJOEJOH#JOEJOH&YDFQUJPO w ϑΝΠϧͷஔ͖ॴؒҧ͑ͯΔ w ϑΝΠϧ໊ʢେจࣈখจࣈͱؚ͔Ίʣؒҧ͑ͯΔ w 3FTPVSDFͷઃఆ͕ແ͍ɺؒҧ͑ͯΔ
ύϥϝλΛ͢ w 42-ͰόΠϯυมͱͯ͠ѻ͏Λ͢ w .BQQFSϝιουͷύϥϝλʹ!1BSBNΞϊςʔγϣϯΛ͚ͭͯύϥϝλ Λ͢ Demo getById(@Param("pk") DemoPk pk);
w 42-ଆͰ\YYY^ \YYY^ͳͲͰύϥϝλΛड͚औΔ where pk = #{pk.value}
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w PSHNZCBUJTTQSJOH.Z#BUJT4ZTUFN&YDFQUJPO w DBVTFECZPSHBQBDIFJCBUJTCJOEJOH#JOEJOH&YDFQUJPO w .BQQFSͱ9.-Ͱύϥϝλ໊͕Ұகͯ͠ͳ͍ w ύϥϝλ໊ॻ͖Ε w
!1BSBNॻ͖Ε
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w PSHNZCBUJTTQSJOH.Z#BUJT4ZTUFN&YDFQUJPO w DBVTFECZPSHBQBDIFJCBUJTSF fl FDUJPO3F fl FDUJPO&YDFQUJPO w
ϓϩύςΟ͕ͳ͍ w ϓϩύςΟ໊ؒҧ͑ͯΔʢେจࣈɾখจࣈʣ w ϓϩύςΟͷ֊Λؒҧ͑ͯΔ
݁ՌΛϚοϐϯά w %#͔Βड͚औͬͨ݁ՌΛฦ٫༻ΫϥεʹϚοϐϯά͢Δ w ͜ͷྻ͜ͷϓϩύςΟʹೖΕΔͱ͔ w SFTVMU5ZQFSFTVMU.BQͷࢦఆ w SFTVMU.BQͰྻຖͷϚοϐϯάࢦఆ
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w PSHNZCBUJTTQSJOH.Z#BUJT4ZTUFN&YDFQUJPO w DBVTFECZPSHBQBDIFJCBUJTSF fl FDUJPO3F fl FDUJPO&YDFQUJPO w
ϓϩύςΟ໊ؒҧ͑ͯΔ
ൃੜz͠ͳ͍zΤϥʔ w 4FMFDUͯ͠ͳ͍ྻ໊Λॻ͍͍ͯͯΤϥʔʹͳΒͳ͍ w ࣮ߦͯ֘͠ͷ߲ʹOVMMίϯετϥΫλͷॳظ͕ೖΔ͚ͩ w +BWBͰೖΕ༻ҙ͚ͨ͠ͲԿೖΒͳ͔ͬͨɺΈ͍ͨͳѻ͍
42-Λ४උ͢Δ w ࣮ߦͷલʹ42-ΛϓϦίϯύΠϧ࣮ͯ͠ߦ४උ͢Δ w .Z#BUJTʹݶΒ͍͍ͣͩͨ͜ͷॲཧ͕͋Δ w ࢀߟKBWBTRM1SFQBSFE4UBUFNFOU
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w จ๏Τϥʔ͜ͷλΠϛϯάͩͱࢥͬͯͨΜ͚ͩͲ ࠓճΑ͘Α֬͘ೝͨ͠Βҧ͏͔ͬͨʂ w ͜ͷλΠϛϯάͰΤϥʔى͜͢ํ๏ࢥ͍͔ͭͳ͔ͬͨͷͰ͍͖࣍·͢ʂ
42-࣮ߦͯ͠%#͔Β݁ՌΛड͚औΔ w ࣮ࡍʹ42-Λ࣮ߦ͢Δ w %BUBTPVSDFΛࢀরͯ͠%#ʹଓ w ଓࣗମ.Z#BUJTͷൣғ֎ʢ)JLBSJ$1ͱ͔ʣ w ݁ՌΛ%#͔Βड͚औΔ w
ਖ਼ৗͳͷ͔ɺҟৗͳͷ͔ w ड͚औͬͨ݁ՌΛݺͼग़͠ݩʹฦ٫Ͱ͖Δܗʹ͢Δͷ͜ͷޙͷॲཧɻ
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w %#ʹͭͳ͕Βͳ͍ɺ%#མͪͯͨɺλΠϜΞτɾɾɾ w ʢଂ)Ͱ͜ͷλΠϛϯάͰى͜͢ͷ͘͠ͳ͍ʁʣ w PSHTQSJOHGSBNFXPSLKECD#BE4RM(SBNNBS&YDFQUJPO w 42-จ๏ޡΓ w
UZQPɺ4&-&$5۟ͷΧϯϚൈ͚ɺςʔϒϧ໊ɾྻ໊ؒҧ͍ɾɾɾɾ
ΦϒδΣΫτʹΛೖ w %#͔Βड͚औͬͨ݁ՌΛ+BWBͷΦϒδΣΫτʹ֨ೲ͢Δ w ֨ೲ͢ΔͨΊͷΠϯελϯεੜ w SFTVMU.BQ͕͋ΕهࡌͷϚοϐϯάͰɺ ͳ͚Εྻ໊ʹԊͬͨϓϩύςΟʹSF fl
FDUJPOͰΛ֨ೲ
ൃੜ͢Δྫ֎ͱz͋Δ͋Δz w PSHNZCBUJTTQSJOH.Z#BUJT4ZTUFN&YDFQUJPO w $BVTFECZPSHBQBDIFJCBUJTSF fl FDUJPO3F fl FDUJPO&YDFQUJPO w
֨ೲ͢ΔΫϥεʹదͳίϯετϥΫλ͕ແ͍ w Ҿͳ͠ίϯετϥΫλ͔ɺ֨ೲ͢Δશ߲ͷҾΛ࣋ͭίϯετϥ Ϋλ͕ଥ w QSJWBUFͰେৎ w ίϯετϥΫλະఆٛͳΒσϑΥϧτͰҾͳ͕͠༻ҙ͞ΕΔ
͓·͚ɿͨ·ʹz͋Δ͋Δz w ίϯετϥΫλϓϩύςΟͪΌΜͱ͋ΔͷʹͳΜ͔͕͏·͍͜ͱ ೖΒͳ͍ͷͳΜͰʁʁʁ w ಛఆͷQSF fi Y͕͍ͭͨϝιου͕HFUUFSTFUUFSͱͯ͠ಈ͍ͯ͠·͏ w HFU
JT DBOʜ w HFU)PHF \JG IPHFOVMM SFUVSOOFX)PHF ^
ྫʣ )PHF\ 'VHBGVHBOFX'VHB )PHF \^ HFU'VHB \ JG GVHBWBMVFOVMM
SFUVSOOFX'VHB SFUVSOGVHB ^ ίϯετϥΫλʹΑΓGVHBOVMMͷ )PHFΠϯελϯε͕࡞ΒΕΔ .Z#BUJTGVHBʹೖ͢ΔͨΊ HFU'VHBͰऔΓग़ͨ͠ϓϩύςΟʹ Λೖ͠Α͏ͱ͢Δ GVHBOVMMͳͷͰ৽͍͠'VHBΠϯ ελϯε͕ฦ͞ΕΔ ̏Ͱ࡞ͬͨΠϯελϯεʹΛೖ )PHFGVHBOVMMͷ··ɾɾɾ )PHF GVHB OVMM GVHB HFU'VHB ೖ
͍͞͝ʹ w ࠓճհͨ͠Ҏ֎ʹ৭ΜͳΤϥʔ͕ൃੜ͠ಘΔ w ͲΜͳ͜ͱΛͲΜͳॱ൪Ͱ͍ͬͯΔͷ͔ΛѲ͠ͳ͕Β ʮ42-࣮ߦͰ͖ͯΔ͔Β͜ͷล͕ؒҧ͑ͯͦ͏ʯ ʮ42-ͷ࣮ߦ͢Βͯ͠ͳ͍͔Β͜͜Βล͔ΒௐΑ͏ʯ
ͱ͔མͪண͍ͯߟ͑ΒΕΔΑ͏ʹͳΔͱخ͍͠Ͱ͢ʂ
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ