Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

DBFlute Bridge on ClubDB2

2,127 views

Published on

DBFlute Show on ClubDB2
http://d.hatena.ne.jp/jflute/20130914/clubdb2

Published in: Technology
  • Be the first to comment

DBFlute Bridge on ClubDB2

  1. 1. DB࡜࢔ࣉࣜ࡜DB2ࢆ ࡘ࡞ࡄᯫࡅᶫ DBFlute ஂಖࠉ㞞ᙪjflute
  2. 2. jflute࡜ࡣ㸽 ஂಖࠉ㞞ᙪ㸦࣮࢜ࣉࣥࢯ࣮ࢫࣉࣟࢢ࣐࣮ࣛ㸧 ! DBFluteࡢస⪅(࣓࢖ࣥࢥ࣑ࢵࢱ) ! S2Dao/Teedaࢥ࣑ࢵࢱ ! Seasar.NETࢥ࣑ࢵࢱ㸤࣮ࣜࢲ࣮ ! jfluteࡢ᪥グ (http://d.hatena.ne.jp/jflute/) ! Twitter: jflute / Facebook: dbflute
  3. 3. ஂಖ࡜ࡣ㸽 ࣇ࣮ࣜࣉࣟࢢ࣐࣮ࣛ ! (୺࡟Javaࡢ)㛤Ⓨ⌧ሙ࡛ࡢࣇ࢛࣮ࣟ࢖ࣥࢢ ! ࢔࣮࢟ࢸࢡࢳࣕタィࠊᐇ⿦ ! 㛤Ⓨࣉࣟࢭࢫࡢᨵၿ㸦⎔ቃᨵၿ㸧 ! DBタィ࢔ࢻࣂ࢖ࢫ ! DBFluteࡢᑟධᨭ᥼ࠊᐇ⿦ᨭ᥼ ! ࢚ࣥࢪࢽ࢔ࡢ஧ḟᡂ㛗ࡢᨭ᥼㸦ᩍ⫱㸧 ! ࣁࣥࢬ࢜ࣥ࡟ࡼࡿᛮ⪃ຊ࢔ࢵࣉ㸟 ! ࢚ࣥࢪࢽ࢔ࡣࡶ࠺୍ᗘᡂ㛗࡛ࡁࡿ㸟
  4. 4. ᐇ⦼ࡣ㸽 ! ᰴᘧ఍♫ࣞ࢖ࣁ࢘࢜ࣜᵝ ! ୰㏵᪂ேࡢ◊ಟ࣭⌧ሙ࡛ࡢࣇ࢛࣮ࣟ࢖ࣥࢢ ! OSSᑟධᨭ᥼ࢧ࣮ࣅࢫ ! ᰴᘧ఍♫ࣅࢬ࣮ࣜࢳᵝ ! DBFluteᑟධ࣭᭱㐺໬ࣇ࢛࣮ࣟࠊ㛤Ⓨ⎔ቃᨵၿᨭ᥼ ! ࢔࣮࢟ࢸࢡࢳࣕタィ࣭ᐇ⿦㸦SAStrutsࡢᣑᙇ࡞࡝㸧 ! ୰㏵࢚ࣥࢪࢽ࢔ࡢDBFluteࣁࣥࢬ࢜ࣥࠊ⌧ሙࣇ࢛࣮ࣟ ! ᪂༞࢚ࣥࢪࢽ࢔ࡢ◊ಟࣇ࢛࣮ࣟࠊJava㸤DBFluteࣁࣥࢬ࢜ࣥ ! ᰴᘧ఍♫ࣝࢡࢧᵝ ! DBFluteᑟධ࣭᭱㐺໬ࣇ࢛࣮ࣟࠊ㛤Ⓨ⎔ቃᨵၿᨭ᥼ ! DBFluteࣁࣥࢬ࢜ࣥࠊ⌧ሙࣇ࢛࣮ࣟ ͤྡ๓ࡢฟࡏࡿ௻ᴗᵝࡢࡳᥖ㍕
  5. 5. DBFlute࡜ࡣ㸽 ! ࢔ࣉࣜෆ࡛ࡢDB࢔ࢡࢭࢫࡢᨭ᥼ ! 㛤Ⓨ⎔ቃ࡛ࡢDB⟶⌮ࡢᨭ᥼
  6. 6. DBFluteࡢ≉ᚩࡣ㸽 ࢫࣆ࣮ࢻࡢ㏿࠸ࣅࢪࢿࢫኚ໬ ࡟⪏࠼ࡽࢀࡿ㛤Ⓨ⎔ቃࡢᨭ᥼࡟≉໬ DBኚ᭦࡟ᙉ࠸
  7. 7. DBFluteࡢࢱ࣮ࢤࢵࢺ ! BtoC࡞࡝ࡢࢧ࣮ࣅࢫ㛤Ⓨ㸦஦ᴗ఍♫㸧 ! ࣮࣭ࣜࣥࢫࢱ࣮ࢺ࢔ࢵࣉ ! ࢖ࣥࢡ࣓ࣜࣥࢱࣝ㛤Ⓨ ! DBタィ࡜ᐇ⿦ࡢྠ᫬㛤Ⓨ ͤࣅࢪࢿࢫࡢࡓࡵࡢἾ⮯࠸ࢶ࣮࡛ࣝ࠶ࡿ
  8. 8. … ࡩ࣮ࢇ
  9. 9. DBFluteࡣኚ࠼ࡓ࠸ ࠉDBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࠉࠉࠉࠉࠉࢠࣕࢵࣉ
  10. 10. ࢠࣕࢵࣉࡗ࡚㸽 DBࢧ࢖ࢻ㸸DBタィࠊDB࢖ࣥࣇࣛ ࢔ࣉࣜࢧ࢖ࢻ㸸࢔ࣉࣜ㛤Ⓨ ஫࠸ࡀ஫࠸࡟㈐ࡵྜ࠺ (T T
  11. 11. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࢠࣕࢵࣉࠉࡑࡢ㸯 DBタィࡢពᅗࡀ ࢔ࣉࣜഃ࡟ఏࢃࡽ࡞࠸
  12. 12. DBFluteࡣDBࢆఏ࠼ࡿ㸟 ! SchemaHTML࡛ࢸ࣮ࣈࣝᐃ⩏ࡢ⮬ື⏕ᡂ ! ࣓ࣥࢸࢼࣥࢫ୙せ (DBࢥ࣓ࣥࢺ㔜ど) ! Ẽᴦ࡟㛤ࡅࡿHTMLᙧᘧ ! DBᐃ⩏ࢆJavaDocࢥ࣓ࣥࢺ࡟ ! DBࢥ࣓ࣥࢺࢆJavaDocࢥ࣓ࣥࢺ࡟
  13. 13. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࢠࣕࢵࣉࠉࡑࡢ㸰 ࢔ࣉࣜഃࡢ㒔ྜ࡟㛵ಀ࡞ࡃ DBኚ᭦ࡉࢀࡿ
  14. 14. DBFluteࡣDBኚ᭦࡟ࡘ࠾࠸㸟 ! ࢱ࢖ࣉࢭ࣮ࣇAPI࡛DBኚ᭦ࡢᙳ㡪⠊ᅖ᳨▱ ! 2WaySQLࡢእࡔࡋSQL୍࡛ᣓᐇ⾜᳨࡛▱ ! ᭱᪂DBᵓ㐀ࡢᶓᒎ㛤ࢆ⮬ື໬ (ReplaceSchema) ! ࢸࢫࢺࢹ࣮ࢱࡢ୍ඖ⟶⌮ ! ࡜࠸࠺࠿୍␒ࡢࡇࡔࢃࡾ
  15. 15. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࢠࣕࢵࣉࠉࡑࡢ㸱 ࡜࠸࠺࠿ࠊDBኚ᭦ࡢෆᐜࡀ ࢔ࣉࣜഃ࡟ఏࢃࡽ࡞࠸
  16. 16. DBFluteࡣDBኚ᭦ࢆఏ࠼ࡿ㸟 ! HistoryHTML࡛ᒚṔࢻ࣓࢟ࣗࣥࢺࢆ⮬ື⏕ᡂ ! JavaDocࢥ࣓ࣥࢺࡸSchemaHTML
  17. 17. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࢠࣕࢵࣉࠉࡑࡢ㸲 ࢔ࣉࣜഃࡀ ࡄࡿࡄࡿ࡜ᅇࡍ
  18. 18. DBFluteࡣ᫂♧୺⩏ ! 㛵㐃ࢸ࣮ࣈࣝࡣྲྀࡾࡓ࠸ࡶࡢࢆ᫂♧ ! get࣓ࢯࢵࢻ࡛ࡢLazyLoadࡣࡋ࡞࠸ ! SQLࡢⓎ⾜ᅇᩘࢆᩘ࠼ࡿࡓࡵࡢᣑᙇ࣏࢖ࣥࢺ
  19. 19. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࢠࣕࢵࣉࠉࡑࡢ㸳 ᮏ␒࡜⤖ྜ࡜㛤Ⓨ࡛ࠊ ࢫ࣮࣐࢟ᵓ㐀ࡀ㐪࠺㸟
  20. 20. DBFluteࡣᕪศ኱ዲࡁ ! HistoryHTML࡛DBኚ᭦ࡢṔྐࢆ᣺ࡾ㏉ࢀࡿ ! AlterCheck࡛Alterᩥࡢᩚྜᛶࢆࢳ࢙ࢵࢡ ! SchemaSyncCheck࡛஧ࡘࡢDBࡢᕪศࢆࢳ࢙ࢵࢡ
  21. 21. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻࡢ ࢠࣕࢵࣉࠉࡑࡢ㸴 ࢔ࣉࣜᒇࡉࢇࡼ࠹… ࣃࣇ࢛࣮࣐ࣥࢫ⪃៖࠾㢪࠸
  22. 22. DBFluteࡣSQLࢆ኱ษ࡟ ! CB࡛ฟຊࡉࢀࡿSQLࡢぢࡓ┠ࡣ㉸኱஦ ! Ⓨ⾜ࡉࢀࡓSQLࡢᐇ⾜᫬㛫ࢆࣟࢢ࡟ ! ࣒࢝ࣛࡢIndex᝟ሗࢆJavaDoc࡟ ! SQLࢆⓎ⾜ࡋࡓࢡࣛࢫࢆࣟࢢ࡟ ! SQLࢆⓎ⾜ࡋࡓᶵ⬟ࢆࢥ࣓ࣥࢺ࡟ᇙࡵ㎸ࡳ!?
  23. 23. DBFluteࡣⱁࡀ⣽࠿࠸ ! ࣐ࢵࣆࣥࢢ࡛ࣜࣇࣞࢡࢩࣙࣥࡣ౑ࢃ࡞࠸ ! EntityࡢSetter࿧ࡧฟࡋ᝟ሗ࡛updateᩥࢆᵓ⠏ ! ࣮࣌ࢪࣥࢢ࡛ࡢSQLⓎ⾜ᅇᩘไᚚ ! ࣉࣟࢩ࣮ࢪࣕ࡟ࡶࡘ࠾࠸㸟 ! ࡶࡕࢁࢇࠊࣂ࢖ࣥࢻኚᩘ࡛ࡍࡼ
  24. 24. DBࢧ࢖ࢻ࡜࢔ࣉࣜࢧ࢖ࢻ ࡝ࡗࡕࡶWinWin࡟࡞ࡗ࡚ࡇࡑࠊ ࠾ᐈᵝࡶ᭱㧗ࡢࢩࢫࢸ࣒࡟ ฟ఍࠼ࡿࡣࡎ
  25. 25. ᯫࡅᶫ ࡑࡢࡓࡵࡢࢶ࣮ࣝࠊ 㑅ࢇ࡛ࡳࡲࡏࢇ࠿㸽
  26. 26. ࡕࡻࡗ࡜࿌▱ 㸯㸮᭶㸯㸷᪥㸦ᅵ㸧 㸯㸱㸸㸮㸮࠿ࡽ㸯㸵㸸㸮㸮㸦㸩᠓ㄯ఍㸧 ࣅࢬ࣮ࣜࢳࠊ࣮࢞ࢹࣥᗈሙ࡟࡚ DBFlute࣮࢞ࢹࣥࣇ࢙ࢫ ࢆ㛤ദ

×