Skip to main content

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

Checked in trunk the patch updated following James' code review:
removed all type checking that I've added to the standard JPA functions (CONCAT, LENGTH etc). Also removed type tests for that functions.
----- Original Message -----
Sent: Monday, March 08, 2010 7:13 AM
Subject: [eclipselink-dev] Re: Bug 300512 - Add FUNCTION support to extendedJPQL

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
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
Please send any feedback you may have.

eclipselink-dev mailing list

Back to the top