<div dir="ltr">ä¹…ä¿(jflute)ã•ã‚“<div><br></div><div>ã”確èªã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚</div><div>ã„ãŸã ã„ãŸä»¶ã§ã™ãŒã€ä»¥ä¸‹ã¨ãªã‚Šã¾ã—ãŸã€‚</div><div><br></div><div>çµæžœã¨ã—ã¦ã€DãŒé–¢é€£ã—ã¦ãŠãã¦ã„ãŸã¨æŽ¨å¯Ÿã—ã¦ãŠã‚Šã¾ã™ã€‚</div><div>ã—ã£ã‹ã‚Šã¨ç¢ºèªã›ãšãŠæ‰‹æ•°ãŠæŽ›ã‘ã—ã¾ã—ãŸï½¥ï½¥ï½¥ã€‚</div><div>→実ã¯xmlファイルã€diffmapãªã©ã‚’管ç†å¯¾è±¡å¤–ã¨ã—ã¦</div><div> å„自ã®ãƒãƒ¼ã‚«ãƒ«ç®¡ç†ã§é‹ç”¨ã—ã¦ã„ãŸã®ã§ã™ãŒ</div><div> ã“ã“ãŒèµ·å› ã—ã¦å·®ç•°ãŒç™ºç”Ÿã—ãŸã¨åˆ¤æ–至りã¾ã—ãŸã€‚</div><div> ※開発上ã€ä¸Šè¨˜ãƒ•ã‚¡ã‚¤ãƒ«ç¾¤ã®å·®åˆ†ã¯</div><div>  実影響ãªã„ã¨ã—ã¦é™¤å¤–ã—ã¦ãŠã‚Šã¾ã—ãŸï½¥ï½¥ï½¥ã€‚</div><div><br></div><div>---------------------------------------------------------</div><div><span style="color:rgb(0,0,0);font-size:14px">A. åŒã˜äººãŒãƒãƒ¼ã‚«ãƒ«ã§ä½•åº¦ã‹ renewal ã™ã‚‹ã¨å…¥ã‚Œæ›¿ã‚る?</span><br style="color:rgb(0,0,0);font-size:14px">→ç§ã®ç’°å¢ƒä¸‹ã§ã¯ã€ç¹°ã‚Šè¿”ã—åŒæ§˜ã®å·®åˆ†ã¨ãªã‚Šã¾ã™ã€‚</div><div><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px">B. 別ã®äººãŒ renwal ã™ã‚‹ã¨å…¥ã‚Œæ›¿ã‚る?</span></div><div>→差分発生ãŒã™ã‚‹äºº/ã—ãªã„人ãŒã„ã¾ã—ãŸã€‚</div><div> ※Dã«é–¢é€£ã¨ã—ã¦ãŠã‚Šã¾ã™ã€‚<br style=""><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px">C. FK制約ã®åå‰ã¯å›ºå®šåŒ–ã•ã‚Œã¦ã„ã¾ã™ï¼Ÿ (SYSXXXã§ã¯ãªã)</span><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px"> => FK制約ãŒé–¢ä¿‚ã—ã¦ã„ã‚‹ã‹ã©ã†ã‹ã®åˆ‡ã‚Šåˆ†ã‘</span></div><div>→replace-schema記載上ã¯å…¨ã¦å‘½å済ã¿ã€</div><div> 且ã¤å®Ÿã‚¹ã‚ーマ上も自動命åã¯ãªã„ã“ã¨ã‚’確èªã—ã¦ãŠã‚Šã¾ã™</div><div><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px">D. SchemaXML (</span><span style="color:rgb(0,0,0);font-size:14px">DBFluteクライアントã®schemaフォルダã®ä¸‹ã®xm<wbr>l</span><span style="color:rgb(0,0,0);font-size:14px">) も差分出ã¦ã‚‹ï¼Ÿ</span><br style="color:rgb(0,0,0);font-size:14px"><span style="color:rgb(0,0,0);font-size:14px"> => XMLã®å‰ã‹ã‚‰å…¥ã‚Œæ›¿ã‚ã£ã¦ã‚‹ã®ã‹ã€</span><span style="color:rgb(0,0,0);font-size:14px">XMLã®å¾Œã§å…¥ã‚Œæ›¿ã‚ã£ã¦ã‚‹<wbr>ã®ã‹ã®åˆ‡ã‚Šåˆ†ã‘</span><br></div><div class="gmail_extra">→発生ã—ãªã„人ã®diffmapã€åŠã³schemaXMLã‚’é…ç½®ã—<br></div><div class="gmail_extra"> renewal実行ã—ãŸæ‰€ã€å·®åˆ†ç™ºç”ŸãŒã—ãªããªã£ãŸ</div><div class="gmail_extra"><br></div><div class="gmail_extra">>ã“ã¡ã‚‰ã® Oracle ã§ã®ãƒ†ã‚¹ãƒˆç’°å¢ƒã§ã¯ã€<br>>何度 renewal ã—ã¦ã‚‚変ã‚ã£ãŸã“ã¨ãŒãªã„ã®ã§ã€<br></div><div class="gmail_extra">ç§ã‚‚é‹ç”¨ä¸Šã„ã¾ã¾ã§ãªã‹ã£ãŸã®ã§ä»Šå›žã®ã”質å•ã«è‡³ã‚Šã¾ã—ãŸãŒ</div><div class="gmail_extra">改ã‚ã¦èªè˜ä¸è¶³ãªç‚¹ç‰ç—›æ„Ÿã—ã¾ã—ãŸã€‚</div><div class="gmail_extra">ãŠæ™‚é–“ã„ãŸã ã申ã—訳ã‚ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚</div><div class="gmail_extra"><br></div><div class="gmail_extra">ãã‚‚ãも差分ãŒç™ºç”Ÿã—ãŸåŽŸå› ã¯ä¸æ˜Žã§ã™ï½¥ï½¥ï½¥ãŒã€</div><div class="gmail_extra">上記より個人ã®XMLã€diffmapãŒå½±éŸ¿åŠã¼ã—ãŸã¨æŽ¨å¯Ÿã—ã¦ãŠã‚Šã¾ã™ã€‚</div><div class="gmail_extra">(ç¾æ™‚点ã§å›žç”ã¨ã—ã¦ã¯è…¹è½ã¡ã„ãŸã—ã¾ã—ãŸ)</div><div class="gmail_extra"><br></div><div class="gmail_extra">※引ã続ãã”利用ã•ã›ã¦ã„ãŸã ãã¾ã™ï¼</div><div class="gmail_extra"> ã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ï¼</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">以上ã€ã‚ˆã‚ã—ããŠé¡˜ã„ã„ãŸã—ã¾ã™ã€‚</div><div class="gmail_extra">--</div><div class="gmail_extra"><br><div class="gmail_quote">2017å¹´12月12æ—¥ 11:10 kubo <span dir="ltr"><<a href="mailto:dbflute@gmail.com" target="_blank">dbflute@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ä¹…ä¿(jflute)ã§ã™<br>
<br>
æˆç”°ã•ã‚“ã€æƒ…å ±ã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚<br>
<span><br>
>Â * [foreign table]<br>
> - *Â Â Â Hoge1, Hoge2<br>
> + *Â Â Â Hoge2, Hoge1<br>
</span>ãªã‚‹ã»ã©ã€FKテーブルã®ãƒ¡ã‚¿ãƒ‡ãƒ¼ã‚¿ã®é †åºã§ã™ã。<br>
一応ã€ãƒ—ãƒã‚°ãƒ©ãƒ çš„ã«ã¯é †åºã‚’ä¿æŒã™ã‚‹ã‚ˆã†ã«ã—ã¦ã„ã‚‹ã®ã§ã™ãŒ.<wbr>..<br>
メタデータã®æµã‚Œã¨ã—ã¦ã¯ä»¥ä¸‹ã®ã‚ˆã†ã«ãªã£ã¦ã„ã¾ã™ã€‚<br>
<br>
1. Oracle JDBCã‹ã‚‰FKæƒ…å ±ã‚’å–å¾—<br>
 => DfForeignKeyExtractor<br>
 => ã“ã®ã¨ãã€å†…部的ã«ã‚½ãƒ¼ãƒˆã—ç›´ã—ã¦ã„ã‚‹ (immobilizeOrder()) ★ãƒã‚¤ãƒ³ãƒˆ<br>
<a href="https://github.com/dbflute/dbflute-core/blob/master/dbflute-engine/src/main/java/org/dbflute/logic/jdbc/metadata/basic/DfForeignKeyExtractor.java#L104" rel="noreferrer" target="_blank">https://github.com/dbflute/dbf<wbr>lute-core/blob/master/dbflute-<wbr>engine/src/main/java/org/dbflu<wbr>te/logic/jdbc/metadata/basic/D<wbr>fForeignKeyExtractor.java#L104</a><br>
<br>
2. SchemaXmlã«ä¿å˜<br>
 => 基本的ã«ãã®ã¾ã¾ã®é †åºã§XMLã«ä¿å˜<br>
<a href="https://github.com/dbflute/dbflute-core/blob/master/dbflute-engine/src/main/java/org/dbflute/logic/jdbc/schemaxml/DfSchemaXmlSerializer.java#L653" rel="noreferrer" target="_blank">https://github.com/dbflute/dbf<wbr>lute-core/blob/master/dbflute-<wbr>engine/src/main/java/org/dbflu<wbr>te/logic/jdbc/schemaxml/DfSche<wbr>maXmlSerializer.java#L653</a><br>
<br>
3. SchemaXmlã‚’èªã¿è¾¼ã‚“ã§Table.javaã§ä¿æŒ<br>
 => XMLã®é †åºã‚’ãã®ã¾ã¾ã‚ープ<br>
<a href="https://github.com/dbflute/dbflute-core/blob/7ff330c93ad05dc5ab7a69d28957c290989c793e/dbflute-engine/src/main/java/org/apache/torque/engine/database/model/Table.java#L1210" rel="noreferrer" target="_blank">https://github.com/dbflute/dbf<wbr>lute-core/blob/7ff330c93ad05dc<wbr>5ab7a69d28957c290989c793e/dbfl<wbr>ute-engine/src/main/java/org/a<wbr>pache/torque/engine/database/m<wbr>odel/Table.java#L1210</a><br>
<br>
※リンクã¯Java8版ã¸ã®ãƒªãƒ³ã‚¯ã§ã™ãŒã€<br>
ãã®è¾ºã®ãƒã‚¸ãƒƒã‚¯ã¯ã»ã¨ã‚“ã©å¤‰ã‚ã£ã¦ãªã„ã¯ãšã§ã€‚<br>
<br>
ã“ã¡ã‚‰ã® Oracle ã§ã®ãƒ†ã‚¹ãƒˆç’°å¢ƒã§ã¯ã€<br>
何度 renewal ã—ã¦ã‚‚変ã‚ã£ãŸã“ã¨ãŒãªã„ã®ã§ã€<br>
ã¡ã‚‡ã£ã¨åŽŸå› ä¸æ˜ŽãªçŠ¶æ…‹ã§ã™ã€‚<br>
(動作ã«æ”¯éšœã¯ãªã„ã«ã›ã‚ˆã€ç´›ã‚‰ã‚ã—ã„ã§ã™ã‚ˆã)<br>
<br>
<br>
ã‚‚ã—ã€åˆ†ã‹ã‚Œã°ä»¥ä¸‹ã®çŠ¶æ³ã‚’æ•™ãˆã¦é ‚ã‘ã‚‹ã¨å¬‰ã—ã„ã§ã™ã€‚<br>
<br>
A. åŒã˜äººãŒãƒãƒ¼ã‚«ãƒ«ã§ä½•åº¦ã‹ renewal ã™ã‚‹ã¨å…¥ã‚Œæ›¿ã‚る?<br>
<br>
B. 別ã®äººãŒ renwal ã™ã‚‹ã¨å…¥ã‚Œæ›¿ã‚る?<br>
<br>
C. FK制約ã®åå‰ã¯å›ºå®šåŒ–ã•ã‚Œã¦ã„ã¾ã™ï¼Ÿ (SYSXXXã§ã¯ãªã)<br>
 => FK制約ãŒé–¢ä¿‚ã—ã¦ã„ã‚‹ã‹ã©ã†ã‹ã®åˆ‡ã‚Šåˆ†ã‘<br>
<br>
D. SchemaXML (DBFluteクライアントã®schemaフォルダã®ä¸‹ã®xm<wbr>l) も差分出ã¦ã‚‹ï¼Ÿ<br>
 => XMLã®å‰ã‹ã‚‰å…¥ã‚Œæ›¿ã‚ã£ã¦ã‚‹ã®ã‹ã€XMLã®å¾Œã§å…¥ã‚Œæ›¿ã‚ã£ã¦ã‚‹<wbr>ã®ã‹ã®åˆ‡ã‚Šåˆ†ã‘<br>
<br>
<br>
FK制約åを使ã£ã¦ãªã„ã‚ã‘ã§ã¯ãªã„ãªã„ã®ã§ã™ãŒã€<br>
ãŸã ã€ã‚½ãƒ¼ãƒˆã®å„ªå…ˆåº¦ã¯ä½Žã„ã®ã§FKカラムãŒå¤‰ã‚ã£ã¦ãªã‘ã‚Œã°ã€<br>
変ã‚らãªã„ã¯ãšã§ã¯ã‚ã‚Šã¾ã™ãŒ...<br>
<br>
// DfForeignKeyExtractor<br>
protected Comparator<String> createImmobilizedComparator(fi<wbr>nal<br>
Map<String, DfForeignKeyMeta> fkMap) {<br>
  return new Comparator<String>() {<br>
    public int compare(String o1, String o2) {<br>
      // sorted by "column names + FK name" (overridden default<br>
sort is by FK name)<br>
      // because FK name might be auto-generated name by DBMS,<br>
      // no change FK but generated classes might be changed<br>
after ReplaceSchema<br>
      // (basically FK name should be named fixedly...)<br>
      // so uses local column names as first key here<br>
      final DfForeignKeyMeta meta1 = fkMap.get(o1);<br>
      final DfForeignKeyMeta meta2 = fkMap.get(o2);<br>
      final Map<String, String> columnNameMap1 =<br>
meta1.getColumnNameMap(); // the map is sorted<br>
      final Map<String, String> columnNameMap2 = meta2.getColumnNameMap();<br>
      final String exp1 =<br>
Srl.connectByDelimiter(columnN<wbr>ameMap1.keySet(), "/") + "," + o1;<br>
      final String exp2 =<br>
Srl.connectByDelimiter(columnN<wbr>ameMap2.keySet(), "/") + "," + o2;<br>
      return exp1.compareTo(exp2);<br>
    }<br>
  };<br>
<div class="m_1623373337963147822gmail-m_3708856925671805872m_8998536757079006799HOEnZb"><div class="m_1623373337963147822gmail-m_3708856925671805872m_8998536757079006799h5">}<br>
______________________________<wbr>_________________<br>
Seasar-user mailing list<br>
<a href="mailto:Seasar-user@ml.seasar.org" target="_blank">Seasar-user@ml.seasar.org</a><br>
<a href="https://ml.seasar.org/mailman/listinfo/seasar-user" rel="noreferrer" target="_blank">https://ml.seasar.org/mailman/<wbr>listinfo/seasar-user</a><br>
</div></div></blockquote></div><br></div></div>