Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Re: Bug 300512 - Add FUNCTION support to extended JPQL

Reworked FUNC following conversation with Peter: now the user can use any
database function they'd like and FuncNode creates FunctionExpression for it
"on the fly".
That means that the name passed to FUNC will be always used as function name
(there is no platform - based name traslation).
Also there is no type checking whatsoever.

Following conversation with James changed FunctionExpression.create method so
that it sets as a locaBase an ExpressionBuilder - in case of FunctionOperator;
also removed
public void printSQLWithoutConversion(ExpressionSQLPrinter printer) method.

Added a bunch of tests testing the standard JPA functions (ABS, MOD etc) into
JUnitJPQLComplexTestSuite.
Because custom functions are platform-dependent the only way to test them is
currently in Oracle tests (because the function that works on MySQL probably
will fail on some other platform; but Oracle tests run on Oracle only).

Added to Oracle JPA tests CustomJPQLTestSuite (which currently contains a
single test for NVL but will grow later) and SpatialJPQLTestSuite (sdo).
----- Original Message -----
Sent: Monday, March 01, 2010 6:09 PM
Subject: Bug 300512 - Add FUNCTION support to extended JPQL

 
This patch is prototype 3 patch + some clean up and tests added.
- defines a new key word FUNC to be used to define new JPQL functions;
- see the new class FuncNode for examples of custom functions:
NVL, TO_NUMBER, TO_DATE and four JGeometry (SDO) functions;
- added more type checking for standard jpa 2.0 functions;
- fixed a couple of adjacent bugs:
Bug 246598 - Unable to parse TRIM in JPA NamedQuery;
Bug 303540 - JPQL: query fails to compile if variable found only in function
parameters.
 
Please send any feedback you may have.
 
Thanks,
 
Andrei

Back to the top