[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] EL building select count() instead of select count(*)
|
In addition to the mapping information:
I notice that pendingExpression is being shared by both queries. That is
certainly not an EclipseLink best practice. What happens if you no longer share
that expression. (i.e. create a fresh expression for each query)
-Tom
Tom Ware wrote:
Can you provide details about how PurchaseFraudJdo is mapped?
-Tom
Anuj Lal wrote:
Eclipselink 11.1.1.3.0 (eclipse link 2.0.3-r7973 )
not building addCount sql correctly
Building select count()… instead of select count(*)….
Same code wokrs fine with 11.1.1.2.0 ( eclipse link
1.2.1-r7082)
Expression pendingExp =
builder.get("reviewStatusCode").
equal(DatabaseCodes.PURCHASE_FRAUD_REVIEW_STATUS_PENDING_REVIEW).
or(builder.get("reviewStatusCode").
equal(DatabaseCodes.PURCHASE_FRAUD_REVIEW_STATUS_BLOCKED_BY_RULES)).
or(builder.get("reviewStatusCode").
equal(DatabaseCodes.PURCHASE_FRAUD_REVIEW_STATUS_BLOCKED_BY_SCORE)).
or(builder.get("reviewStatusCode").equal(DatabaseCodes.PURCHASE_FRAUD_REVIEW_STATUS_FOLLOW_UP));
// count all purchases pending fraud review
ReportQuery rptQuery = new ReportQuery(PurchaseFraudJdo.class,
pendingExp);
rptQuery.addCount();
rptQuery.bindAllParameters();
rptQuery.setShouldReturnSingleValue(true);
server.registerToplinkQuery(FIND_PENDING_COUNT, rptQuery);
building a query like this
SELECT COUNT() FROM PURCHASE_ORDER t0, PURCHASE_FRAUD t1 WHERE
(((((t1.REVIEW_STATUS = ?) OR (t1.REVIEW_STATUS = ?)) OR
(t1.REVIEW_STATUS = ?)) OR (t1.REVIEW_STATUS = ?)) AND
(t0.PURCHASE_ORDER_ID = t1.PURCHASE_ORDER_ID))
bind => [P, R, S, F]
giving parsing expression
it building COUNT() instead of COUNT(*)
------------------------------------------------------------------------
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users