Sharing an experience....
findByCondition - is deprecated and hence not suggested. This might hit 
performance later.

Food for thought --
findByAnd , findList are preferred to findByCondition.
Also condition can be made by EntityCondition - A static class of all the 
condition may be used to be used later by all developers.

Dev


From:
"Skip" <s...@thedevers.org>
To:
<user@ofbiz.apache.org>
Date:
05/01/2012 10:04 PM
Subject:
RE: Need to fetch records using multiple ids in where clause



Try this:

                                 List productIds = 
UtilMisc.toList("product1", "product2", etc);
            List productsList  = delegator.findByCondition("Product", new
EntityExpr("productId", EntityOperator.IN, productIds), null, null);

You can also use findByAnd

Skip

-----Original Message-----
From: krishan.bab...@paxcel.net [mailto:krishan.bab...@paxcel.net]
Sent: Tuesday, May 01, 2012 5:20 AM
To: user@ofbiz.apache.org
Subject: Need to fetch records using multiple ids in where clause


Hi All,

I want to fetch products' details using multiple product ids in where 
clause
so that there should be a single query for all the products to be shown in
single page.
Similarly I want to fetch multiple products for multiple categories like 
at
home page I am showing all the products of 3 different categories say 
mostly
sold, mostly viewed, recently sold. So my concern is fetching all the data
in one go instead of calling same query/service again and again.

Please let me know if such services already exist?


Thanks,
Krishan Babbar
----------------------------------------------------------------------------
------------------------------------------------
Disclaimer: This email and any files transmitted with it may contain
privileged or confidential information. It is solely for use by the
individual for whom it is intended even if addressed incorrectly. If you
received this email in error please notify the sender, do not disclose,
copy, distribute or take any action in reliance on the contents of this
information; and delete it from your system. Any other use of this email 
is
prohibited. Thank you for your compliance.





=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


Reply via email to