[OFBiz] Users - another entity question
Michael Kuefner
ofbiz at herr-minni.de
Thu Sep 30 03:42:57 EDT 2004
Hi Si,
On Wed, Sep 29, 2004 at 02:18:04PM -0700, Si Chen wrote:
> Hi everyone. Now I have another entity related question: is there a
> way to do the equivalent of
>
> select distinct productFeatureTypeId from productFeature where
> productFeatureCategoryId = "<...>"
do something like:
-----------------------------------------------------------------------
EntityListIterator iterator = delegator.findListIteratorByCondition(
"productFeature",
new EntityExpr(
"productFeatureCategoryId",
EntityOperator.EQUALS,
"<...>"
),
null,
UtilsMisc.toList("productFeatureTypeId"),
null,
new EntityFindOptions(
true,
EntityFindOptions.TYPE_SCROLL_INSENSITIVE,
EntityFindOptions.CONCUR_READ_ONLY,
true
)
);
// don't forget to close the iterator. It holds a database connection!
iterator.close();
-----------------------------------------------------------------------
A explanation:
the "distinct" feature can be done by setting the last parameter
(boolean distinct) of EntityFindOptions to true.
Also have a look at the other findXX Methods in GenericDelegator ;)
Minni
--
Michael Küfner Meisterbohne eLösungen
Söflinger Strasse 100
Tel: +49-(0)731-399 499 0 D-89077 Ulm
http://www.meisterbohne.de
More information about the Users
mailing list