Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-dev] isDynamicSQLRequiredForFunctions used in select list

The coalesce function is a special dynamically built function.  It is built in Expression.coalesce(), not in the platform (that one seems to be ignored entirely).
This is the same as is done for the case function I think.

This is unfortunate, as it does not allow the platform to give its own syntax for the function, or customize it in any way.  I think the code should be changed to somehow allow the platform to customize these functions, perhaps during the printing of the SQL.
Please log a bug for this.  You could either look into fixing the bug, or for now, just set operator.setIsBindingSupported(false) in the Expression.coalesce().


-----Original Message-----
From: Dies Koper [mailto:diesk@xxxxxxxxxxxxxxxxxxx]
Sent: Tuesday, January 12, 2010 1:36 AM
To: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] isDynamicSQLRequiredForFunctions used in select list

Hi James,

I noticed your addition of isDynamicSQLRequiredForFunctions to some of
the database platforms.
As Symfoware also has a number of functions which do not allow
parameters, I've been looking at using this so I don't need to disable
primitive binding completely.

Is my understanding correctly that when I use that, I need to call
operator.setIsBindingSupported(false); on each of the operators that do
not allow parameters as arguments?

That's what I did, and all but the following test pass:
 org.eclipse.persistence.testing.tests.jpa.criteria.JUnitCriteriaSimpleTestSuite.simpleCoalesceInSelectTest

This particular test has COALESCE in the select list, and Symfoware
complains about the input parameter used as argument:

COALESCE(t0.F_NAME,t0.L_NAME,? ) FROM CMP3_EMPLOYEE t0, CMP3_SALARY t1
WHERE ((t0.F_NAME = ?) AND (t1.EMP_ID = t0.EMP_ID)) bind => [Bobby, Bob]

I call setIsBindingSupported on ExpressionOperator.coalesce() before I
add the Symfoware platform operator, but the third parameter became an
input parameter.
Is this as expected?

Thanks,
Dies

_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


Back to the top