Hello,<br><br>Thanks..<br><br><br><br><div class="gmail_quote">On Thu, Jul 2, 2009 at 3:48 PM, kubo <span dir="ltr"><<a href="mailto:dbflute@gmail.com">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, this is jflute<br>
<br>
You can implement like this:<br>
cb.query().queryMemberStatus().setMemberStatusName_Xxx(...);<br>
<br>
<br>
Please watch the "dbflute-basic-example" project.<br>
The example will help you use DBFlute.<br>
<br>
// dbflute-basic-example<br>
<div class="im"><a href="https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-basic-example" target="_blank">https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-basic-example</a><br>
<br>
</div>// ConditionBeanBasicTest<br>
<div class="im"><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>
</div>2009/7/2 thomas <<a href="mailto:jp.mcy.10@gmail.com">jp.mcy.10@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Ha,<br>
><br>
> MemberCB cb = new MemberCB();<br>
> cb.setupSelect_MemberStatus();<br>
><br>
> //cb.query.setMemberId("AAA");<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.<br>
>><br>
>> getMemberStatusName();<br>
>> ...<br>
>> }<br>
><br>
> by using cb.query.setXXXXXX(), i can set conditions only for Member Tabel.<br>
><br>
> How can i set the condition for memberstatus table?<br>
> Is it Possible in DBFlute ConditionBean?<br>
><br>
> Thanks in advance,<br>
> トマス<br>
><br>
><br>
><br>
><br>
><br>
><br>
> 2009/6/12 thomas <<a href="mailto:jp.mcy.10@gmail.com">jp.mcy.10@gmail.com</a>><br>
>><br>
>> Hai,<br>
>><br>
>> Thanks for your reply...<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.<br>
>>><br>
>>> getMemberStatusName();<br>
>>> ...<br>
>>> }<br>
>><br>
>><br>
>> This is what i want...<br>
>><br>
>> Thank you very much.<br>
>><br>
>><br>
>> Regards,<br>
>> トマス<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Fri, Jun 12, 2009 at 1:03 AM, kubo <<a href="mailto:dbflute@gmail.com">dbflute@gmail.com</a>> wrote:<br>
>>><br>
>>> 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>
>>><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<br>
>>> 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>
>>><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>
>>><br>
>>> On Thu, Jun 11, 2009 at 11:56 PM, kubo<<a href="mailto:dbflute@gmail.com">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">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<br>
>>> >> 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">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">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">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>
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>
</div></div></blockquote></div><br>