Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SpringBoot+MyBatisで例外が出たときどこを見るか
Search
syukai
March 27, 2024
Programming
0
260
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
March 27, 2024
Tweet
Share
More Decks by syukai
See All by syukai
ブランチ運用とデプロイフローを見直してリリースを楽にする
syukai
4
890
ノート付き-ブランチ運用とデプロイフローを見直してリリースを楽にする
syukai
0
62
TypeScriptとテストをはじめた
syukai
0
1k
一歩ずつ進めるVue.js
syukai
2
390
kanjava20170326
syukai
0
550
Other Decks in Programming
See All in Programming
社内活動の取り組み紹介 ~ スリーシェイクでこんな取り組みしてます ~
bells17
0
370
Functional Event Sourcing using Sekiban
tomohisa
0
130
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
600
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
160
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.3k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
410
Leverage LLMs in Java with LangChain4j and Quarkus
hollycummins
0
110
MoQとか勉強会#2 発表資料
yuki_uchida
1
120
Djangoの開発環境で工夫したこと - pre-commit / DevContainer
hiroki_yod
1
560
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
3.7k
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
7
2.8k
[KR] Open-Source Ecosystems
skydoves
0
110
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
GitHub's CSS Performance
jonrohan
1030
460k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Code Reviewing Like a Champion
maltzj
520
39k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
150
Agile that works and the tools we love
rasmusluckow
327
21k
The Cost Of JavaScript in 2023
addyosmani
45
6.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.3k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
24k
How GitHub (no longer) Works
holman
310
140k
Being A Developer After 40
akosma
87
590k
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-ͷ࣮ߦ͢Βͯ͠ͳ͍͔Β͜͜Βล͔ΒௐΑ͏ʯ
ͱ͔མͪண͍ͯߟ͑ΒΕΔΑ͏ʹͳΔͱخ͍͠Ͱ͢ʂ
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ