[Seasar-user:6476] Re: [DBFlute] 外部テーブル結合について

kubo [E-MAIL ADDRESS DELETED]
2007年 3月 3日 (土) 18:13:56 JST


$B5WJ]$G$9!#(B

$BJF86$5$s$X(B

> $B-!(BDBFlute$B$O!"(Bgenerate$B;~$K(BDB$B$NJ*M}E*$J30It%-!<@)Ls$,$"$k>l9g!"%F!<%V%k4V$N4XO"$rG'<1$7$F(BsetupSelect_Xxx()$B%a%=%C%I$r:[E-MAIL ADDRESS DELETED]$9$k!#(B
> 
> $B-"(BDB$B$NJ*M}E*$J30It%-!<@)Ls$,$J$$>l9g$G!"(BsetupSelect_Xxx()$B%a%=%C%I$[E-MAIL ADDRESS DELETED]@.$7$?$$>l9g$O(BAdditional ForeignKey$B$[E-MAIL ADDRESS DELETED]$7$F(Bgenerate$B$9$k$3$H$GBeBX2DG=$G$"$k!#(B
> 
> $B-#K|$,0l!"(Bupdate$B$d(Bdelete$B$G(Bjoin$B$r;H$$$?$$>l9g$O30$@$7(BSQL$B$K$FBP1~!#(B
> 
> $B-$!!-!!"-"$$$:$l$b(BDBFlute$B<[E-MAIL ADDRESS DELETED]@.%a%=%C%I$,BP1~$7$F$$$k$N$O(Bleft outer join$B$N$_$G$"$k!#$=$l0J30$N7k9g$r$7$?$$>l9g$O!"30$@$7(BSQL$B!"!J(BSQL2Entity$B!K$r$K$FBP1~$9$k!#(B

$B40`z$G$9!#$P$C$A$j9g$C$F$$$^$9!#(B



$B$D$$$G$J$N$G!"JdB-(B($[E-MAIL ADDRESS DELETED](B!?)$B$rF~$l$5$;$FD:$-$^$9!#(B



$B!V#1!W$K4X$7$F(B

$BFC<l$J%Q%?!<%s$,$"$j$^$9!#(B

DBFlute$B$N(BSample$B%W%m%8%'%/%H!V(BLDB$B!W(B
http://dbflute.sandbox.seasar.org/ja/about-ldb.html

$B$G$N(B Collection $B$H(B CollectionStatus $B$N$h$&$J(B
one-to-one $B$N4X78$N>l9g$K!"(B

CollectionStatusCB$B$K(B
$B!V(BCollectionStatus left outer join Collection$B!W$N(BsetupSelect_Collection();
$B$,<[E-MAIL ADDRESS DELETED]@.$5$l$k$N$OEvA3$G$9$,!"(B

CollectionCB$B$K!V(BCollection left outer join CollectionStatus$B!W$N(B
setupSelect_CollectionStatusAsOne(); $B$[E-MAIL ADDRESS DELETED]@.$5$l$^$9!#(B

$B$3$l$O!"9=B$$+$i(BDBFlute$B$,(B one-to-one $B$HG'<1$G$-$k$?$a$G$9!#(B
(1:1 $B$r7k9g$G$-$J$$$H$5$9$,$K(BConditionBean$B$NL>$,$9$?$k(B...)

$B$3$N>l9g(B(LDB)$B$O!";R6!$N(BPK$B$,F1;~$K(BFK$B$G$9$,!";R6!$N(BPK$B$O(BIdentity$B$N(B
$BBeM}%-!<$G!"(BPK$B$G$J$$(BFK$B$N(BCollectionID$B$K!V%f%K!<%/@)Ls!W$rIU$1$F$$$k$H(B
$BF1MM$K(B one-to-one $B$HG'<1$5$l$F>e5-$N$h$&$J(BMethod$B$,:[E-MAIL ADDRESS DELETED]$5$l$^$9!#(B



$B!V#2!W$K4X$7$F(B

Additional ForeignKey $B$[E-MAIL ADDRESS DELETED]$9$k:]$K!"$I$&$7$F$b(Bbuild.properties$B$N(B
$B!V2~9T$9$k$H$-$O9T$N:G8e$K!V!o!W$rIU$1$J$1$l$P$J$i$J$$!W(B
$B$H$$$&@)Ls$,$"$j$^$9!#(B
$B$3$l$,$^$?7k9=BgJQ$G!"<+J,$N<~$j(B($B$H$$$&$+<+J,$b(B)$B$G$b!"$3$l$rIU$1K:$l$F(B
$B<[E-MAIL ADDRESS DELETED]@.;~$K%(%i!<$K$J$C$F$7$^$&%1!<%9$,B?$/$"$j$^$9!#(B

$B:G?7$N(BDBFlute-0.4.3(snapshot)$B$G$O!"(B
DBFlute$B$N(BClient_Directory(playsql$B$d(Bschema$B$,$"$k$H$3$m(B)$B$K(B
$B!V(Bdfprop$B!W$H$$$&(BDirectory$B$r:[E-MAIL ADDRESS DELETED]$7!"$=$3$K(B
$B!V(BadditionalForeignKeyMap.dfprop$B!W$H$$$&%U%!%$%k$r:[E-MAIL ADDRESS DELETED]$7$F!"(B
$B$=$N%U%!%$%k$NCf$G(B

map:{
    ; FK_XXXXR  = map:{
        ; localTableName  = xxxx ; foreignTableName  = xxx
    }
    ...
}

$B$H5-=R$9$k$3$H$K$h$C$F!"(BadditionalForeignKeyMap$B$[E-MAIL ADDRESS DELETED]$r(B
$B!V30$@$7!W$9$k$3$H$,$G$-$^$9!#(B
$B$3$l$K$h$j!"!V!o!WL5$7$G5-=R2DG=$J$N$G?oJ,$H4V0c$$$,8:$k$+$H;W$$$^$9!#(B
$B$=$NB>!V(Bmap:{}$B!W7O$bF1MM$G$9!#%W%m%Q%F%#L>$+$i!V(Btorque.$B!W$r=|5n$7$?(B
$B$b$N$r$=$N$^$^%U%!%$%kL>$K$7$F!"3HD%;R$,!V(B.dfprop$B!W$G$9!#(B

$B$3$A$i!"$^$@<B83CJ3,$G$O$"$j$^$9$,!"<+%W%m%8%'%/%H$K$F(B

additionalForeignKeyMap.dfprop
classificationDefinitionMap.dfprop
classificationDeploymentMap.dfprop

$B$H:[E-MAIL ADDRESS DELETED]$7$F!"(BDBA$B$G$J$/%W%m%0%i%^$,<+J,$[E-MAIL ADDRESS DELETED]$9$k2DG=@-$N$"$k(B
$B%W%m%Q%F%#$r30$@$7$K$7$F!"(Bbuild.properties$B$rBg@*$N?M$K(B
$BJT=8$5$;$J$$$H$$$&$&$l$7$$I{:nMQ$,$"$j$^$7$?!#(B

$B:#$N$H$3$m%I%-%e%a%s%H$O2?$b$J$$$G$9$,!"(B
$B5!G=$[E-MAIL ADDRESS DELETED]}$G$-$?$i8x3+$7$?$$$H;W$$$^$9!#(B



$B!V#3!W$K4X$7$F(B

$B$3$l$O8=>u$G$O!"(B

$B0lC6!"(BConditionBean$B$G99?7BP>]$N%l%3!<%I$r8!:w$7$F!"(B
1$B7o$:$D(B update / delete $B$r9T$&!#(B

$B$H$$$&J}K!$,9M$($i$l$^$9$,!"Lk4V%P%C%A$J$I$G%Q%U%)!<%^%s%9$r(B
$B>e$2$?$$>l9g$J$I$O!"$4;XE&$NDL$j!V30$@$7(BSQL$B!W$7$+J}K!$O$"$j$^$;$s!#(B

$B>-Mh!"(BConditionBean $B$r0z?t$K$7$?(B update / delete $B%a%=%C%I$J$I$r(B
$B9M$($F$*$j$^$9$,!"$b$&>/$[E-MAIL ADDRESS DELETED]$NOC$K$J$j$=$&$G$9!J(Bm_m$B!K!#(B



$B!V#4!W$K4X$7$F(B

$B$3$l$O!"(BDBFlute$B$N(BPolicy$B$H$J$j$^$9!#(B
http://dbflute.sandbox.seasar.org/ja/condition_bean_policy.html
$B$K=q$+$;$F$b$i$C$F$$$^$9$,!"(B
$BA4$F$N(BSQL$B$r<[E-MAIL ADDRESS DELETED]@.$9$k$N$O5U$K4m81$H9M$($F$*$j$^$9(B($B$=$b$=$bL5M}$@$7(B)$B!#(B
$B$b$A$m$s!"0U8+!&MWK>Ey$J$I$G>-MhI,$:$7$b$=$&$G$O$J$$$+$b$7$l$^$;$s$,!"(B
$B:#$$$^$O$=$N$h$&$K<+J,$O9M$($F$$$k<!Bh$G$9!#(B

$B$=$NJ,!"(BDBFlute$B$O!"(BS2Dao$B$N6/NO$JIp4o$G$"$k!V30$@$7(BSQL$B!W$r(B
Sql2Entity$B$GBg$$$K%5%]!<%H$7$^$9!#(B



$B$H$A$g$C$HD9J8=q$+$;$F$$$?$@$-$^$7$?$,!"(B
$B$d$O$j%I%-%e%a%s%H$,$^$@$^$@B-$j$F$$$^$;$s$M!#(B
$B$3$l$+$i$b4hD%$j$^$9$N$G$h$m$7$/$*4j$$$7$^$9!#(B

$B$3$N$h$&$JG'<1$N3NG'$H$$$&$h$&$J<ALd%a!<%k$bBg4?7^$G$9!#(B
$B$"$j$,$H$&$4$6$$$^$9!#(B






Seasar-user メーリングリストの案内