<div dir="ltr">$B>.NS(B (koichik) $BMM(B<br><br>conpota$B$G$9!#(B<br><br>$B$G$-$^$7$?!*(B<br>$B2sEz$"$j$,$H$&$4$6$$$^$7$?!#(B<br><br><div class="gmail_quote">2008/09/09 18:00 Koichi Kobayashi <span dir="ltr"><<a href="mailto:koichik@improvement.jp">koichik@improvement.jp</a>></span>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">$B>.NS(B (koichik) $B$G$9!%(B<br>
<br>
Date: Tue, 9 Sep 2008 17:15:15 +0900<br>
From: <a href="mailto:conpota@gmail.com">conpota@gmail.com</a><br>
To: <a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>
Subject: [Seasar-user:15710] [S2JDBC]$BJ#?t%F!<%V%k$N7k9g(B<br>
<div class="Ih2E3d"><br>
> $B$5$i$K%F!<%V%k$r7k9g$7$F(B<br>
> Two two =<br>
> jdbcManager.from(Two.class).innerJoin("oneTwo").innerJoin("oneTwo.oneList").where("name<br>
> = ?", "two1").getSingleResult();<br>
> $B$H$9$k$H0J2<%(%i!<$K$J$j$^$9!#(B<br>
> $B%(%s%F%#%F%#(B(One)$B$N%W%m%Q%F%#(B(oneTwo)$B$,IT@5$G$9!#(BJoinColumn$B$N(Bname$B$G;XDj$5$l$F$$$k30It%-!<(B(ONE_TWO_ID)$B$,B8:_$7$^$;$s!#(B<br>
<br>
</div><div class="Ih2E3d">> One$B%(%s%F%#%F%#(B<br>
> @ManyToOne<br>
> public OneTwo oneTwo;<br>
<br>
</div>One $B$+$i(B OneTwo $B$X$N4XO"$,B?BP(B 1 $B$J$i!$(B<br>
one $B$+$i(B one_two $B$X$N30It%-!<$,I,MW$G$9$,!$(B<br>
<div class="Ih2E3d"><br>
> CREATE TABLE one(<br>
> id SERIAL PRIMARY KEY,<br>
> name VARCHAR(64) NOT NULL<br>
> );<br>
<br>
</div>$B$"$j$^$;$s!%(B<br>
$B!V30It%-!<(B(ONE_TWO_ID)$B$,B8:_$7$^$;$s!W$O(B<br>
$B$=$&$$$&0UL#$G$9!%(B<br>
<br>
$B<B:]$O(B one_two $B%F!<%V%k$,4XO"%F!<%V%k$G$7$g$&$+$i!$(B<br>
one $B%F!<%V%k$K30It%-!<$r;}$A$?$$$o$1$G$O$J$/!$(B<br>
One#oneTwho $B$NB?=EEY$N;XDj$,4V0c$C$F$$$k$N$@$H(B<br>
$B;W$$$^$9!%(B<br>
<br>
$BNc$($P!$4XO"%F!<%V%k$r30$7$F9M$($?>l9g$K(B<br>
# '*' $B$OB?$NB&(B<br>
<br>
+-----+ +-----+ +-------+<br>
| One |*---| Two |---*| Three |<br>
+-----+ +-----+ +-------+<br>
<br>
$B$H$7$?$$>l9g!$4XO"%F!<%V%k$r4^$a$k$H(B<br>
<br>
+-----+ +--------+ +-----+ +----------+ +-------+<br>
| One |----| OneTwo |*---| Two |---*| TwoThree |----| Three |<br>
+-----+ +--------+ +-----+ +----------+ +-------+<br>
<br>
$B$H$J$j$^$9!%(B<br>
$B$^$?!$4XO"$O30It%-!<$r;}$C$F$$$kB&$,=jM-B&$J$N$G!$(B<br>
One$B!$(BTwo$B!$(BThree $B$N;}$D4XO"$OA4$FHo=jM-B&$H$J$j!$(B<br>
mappedBy $B$,I,MW$K$J$j$^$9!%(B<br>
<br>
One$B%(%s%F%#%F%#(B<br>
@OneToOne(mappedBy = "one")<br>
public OneTwo oneTwo;<br>
<br>
Two$B%(%s%F%#%F%#(B<br>
@OneToMany(mappedBy = "two")<br>
public List<OneTwo> oneTwoList;<br>
@OneToMany(mappedBy = "two")<br>
public List<TwoThree> twoThreeList;<br>
<br>
Three$B%(%s%F%#%F%#(B<br>
@OneToOne(mappedBy = "three")<br>
<div class="Ih2E3d">public TwoThree twoThree;<br>
<br>
OneTwo$B%(%s%F%#%F%#(B<br>
@OneToOne<br>
</div>public One one;<br>
@ManyToOne<br>
public Two two;<br>
<br>
TwoThree$B%(%s%F%#%F%#(B<br>
@ManyToOne<br>
public Two two;<br>
@OneToOne<br>
public Three three;<br>
<br>
<br>
--<br>
<component name="koichik"><br>
<property name="fullName">"Koichi Kobayashi"</property><br>
<property name="email">"<a href="mailto:koichik@improvement.jp">koichik@improvement.jp</a>"</property><br>
<property name="blog">"<a href="http://d.hatena.ne.jp/koichik" target="_blank">http://d.hatena.ne.jp/koichik</a>"</property><br>
</component><br>
<br>
_______________________________________________<br>
Seasar-user mailing list<br>
<a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>
<a href="https://ml.seasar.org/mailman/listinfo/seasar-user" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>conpota <<a href="mailto:conpota@gmail.com">conpota@gmail.com</a>><br>
</div>