Ha,<br><br>MemberCB cb = new MemberCB();<br>
<span style="background-color: rgb(255, 153, 102);">cb.setupSelect_MemberStatus(); </span><br>
<br><span style="background-color: rgb(255, 204, 204);">//cb.query.setMemberId("AAA");</span><br><br>
List<Member> memberList = memberBhv.selectList(cb);<br>
for (Member member : memberList) {<br>
// columns of MEMBER table<br>
Integer memberId = member.getMemberId();<br>
String memberName = member.getMemberName();<br>
<br>
// columns of MEMBER_STATUS table<br>
MemberStatus memberStatus = member.getMemberStatus(); // *Point!<br>
String memberStatusName = memberStatus.<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">getMemberStatusName();<br>
...<br>
}</blockquote><div><br>by using cb.query.setXXXXXX(), i can set conditions only for Member Tabel. <br></div><div><br>How can i set the condition for memberstatus table?<br>Is it Possible in DBFlute ConditionBean?<br><br>
Thanks in advance,<br>トマス <br></div><br><br><br><br><br><br><div class="gmail_quote">2009/6/12 thomas <span dir="ltr"><<a href="mailto:jp.mcy.10@gmail.com">jp.mcy.10@gmail.com</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;">
Hai,<br><br>Thanks for your reply...<div class="im"><br><br>/= = = = = = = = = = = = = = = = = = = = = = = = = = = =<br>
MemberCB cb = new MemberCB();<br>
cb.setupSelect_MemberStatus(); // *Point!<br>
<br>
List<Member> memberList = memberBhv.selectList(cb);<br>
for (Member member : memberList) {<br>
// columns of MEMBER table<br>
Integer memberId = member.getMemberId();<br>
String memberName = member.getMemberName();<br>
<br>
// columns of MEMBER_STATUS table<br>
MemberStatus memberStatus = member.getMemberStatus(); // *Point!<br>
String memberStatusName = memberStatus.<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">getMemberStatusName();<br>
...<br>
}</blockquote><br><br><br></div>This is what i want...<br><br>Thank you very much.<br><br><br>Regards,<br>トマス<div><div></div><div class="h5"><br><br><br><br><br><br><br><div class="gmail_quote">On Fri, Jun 12, 2009 at 1:03 AM, kubo <span dir="ltr"><<a href="mailto:dbflute@gmail.com" target="_blank">dbflute@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br>
<br>
Sorry, it's about time for me to go to bed...<br>
I can not make my reply for several hours.<br>
(until next morning in Japan)<br>
So I'm trying to write what I can write now.<br>
<br>
<br>
If you want to select MEMBER and MEMBER_STATUS,<br>
(MEMBER and MEMBER_STATUS : many-to-one)<br>
you can implement in condition-bean like this:<br>
<br>
/= = = = = = = = = = = = = = = = = = = = = = = = = = = =<br>
MemberCB cb = new MemberCB();<br>
cb.setupSelect_MemberStatus(); // *Point!<br>
<br>
List<Member> memberList = memberBhv.selectList(cb);<br>
for (Member member : memberList) {<br>
// columns of MEMBER table<br>
Integer memberId = member.getMemberId();<br>
String memberName = member.getMemberName();<br>
<br>
// columns of MEMBER_STATUS table<br>
MemberStatus memberStatus = member.getMemberStatus(); // *Point!<br>
String memberStatusName = memberStatus.getMemberStatusName();<br>
...<br>
}<br>
- - - - - - - -<br>
Please watch the method 'ConditionBeanBasicTest.test_basic_Tx()'.<br>
<a href="https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-basic-example/src/test/java/com/example/dbflute/basic/dbflute/howto/jp/ConditionBeanBasicTest.java" target="_blank">https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-basic-example/src/test/java/com/example/dbflute/basic/dbflute/howto/jp/ConditionBeanBasicTest.java</a><br>
= = = = = = = = = =/<br>
<br>
<br>
If you want to select MEMBER and PURCHASE,<br>
(MEMBER and PURCHASE : one-to-many)<br>
you can implement in condition-bean like this:<br>
<br>
/= = = = = = = = = = = = = = = = = = = = = = = = = = = =<br>
MemberCB cb = new MemberCB();<br>
<br>
// At first, it selects the list of Member.<br>
ListResultBean<Member> memberList = memberBhv.selectList(cb);<br>
<br>
// And it loads the list of Purchase with its conditions.<br>
memberBhv.loadPurchaseList(memberList, new ConditionBeanSetupper<PurchaseCB>() {<br>
public void setup(PurchaseCB cb) {<br>
cb.query().setPurchaseCount_GreaterEqual(2);<br>
cb.query().addOrderBy_PurchaseCount_Desc();<br>
}<br>
}); // *Point!<br>
<br>
for (Member member : memberList) {<br>
// columns of MEMBER table<br>
Integer memberId = member.getMemberId();<br>
String memberName = member.getMemberName();<br>
<br>
// list of purchase for current member.<br>
List<Purchase> purchaseList = member.getPurchaseList(); // *Point!<br>
for (Purchase purchase : purchaseList) {<br>
// columns of Purchase table<br>
Integer purchaseId = purchase.getPurchaseId();<br>
...<br>
}<br>
}<br>
- - - - - - - -<br>
Please watch the method 'BehaviorMiddleTest.test_loadReferrer_Tx()'.<br>
<a href="https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-basic-example/src/test/java/com/example/dbflute/basic/dbflute/howto/jp/BehaviorMiddleTest.java" target="_blank">https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-basic-example/src/test/java/com/example/dbflute/basic/dbflute/howto/jp/BehaviorMiddleTest.java</a><br>
= = = = = = = = = =/<br>
<div><div></div><div><br>
On Thu, Jun 11, 2009 at 11:56 PM, kubo<<a href="mailto:dbflute@gmail.com" target="_blank">dbflute@gmail.com</a>> wrote:<br>
> Hello, this is jflute<br>
><br>
> I'm sorry that I can not accurately understand your question.<br>
> What does it mean "more than one table"?<br>
><br>
> Let me show this example database for our communication.<br>
> <a href="http://dbflute.sandbox.seasar.org/view/exampledb/index.html?goto=1" target="_blank">http://dbflute.sandbox.seasar.org/view/exampledb/index.html?goto=1</a><br>
><br>
> Does it means, for example,<br>
> "MEMBER and MEMBER_STATUS"?<br>
> (related two tables)<br>
><br>
> select mbr.MEMBER.MEMBER_ID<br>
> mbr.MEMBER.MEMBER_NAME<br>
> mstat.MEMBER_STATUS_NAME<br>
> from MEMBER mbr<br>
> left outer join MEMBER_STATUS mstat<br>
> on mbr.MEMBER_STATUS_CODE = mstat.MEMBER_STATUS_CODE<br>
><br>
><br>
> 2009/6/11 thomas <<a href="mailto:jp.mcy.10@gmail.com" target="_blank">jp.mcy.10@gmail.com</a>>:<br>
>> hai,<br>
>><br>
>> I want to clarify one thing.<br>
>> Is there any other way to select values from more than one table without<br>
>> using outside SQL?<br>
>><br>
>> If there is any way how can i get the values from more than one table?<br>
>><br>
>> Regards,<br>
>> トマス<br>
>><br>
>> _______________________________________________<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" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
>><br>
>><br>
><br>
_______________________________________________<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" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>