Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] EL building select count() instead of select count(*)

                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(*)


Back to the top