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

Coalesce and Case are the only dynamically built functions.


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

Hi James,

Thanks for your reply.

I have opened the following bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=299462

> 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.

I set setIsBindingSupported(false) on quite a number of operators.
Not all of them disallow parameters in each argument, some disallow it
only on a particular argument, or on all at the same time.

So if these get ignored that worries me. Do you have any idea how to
find out what other's are ignored?
(apart from writing many tests, of course :))

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

Yes, that worked.

Cheers,
Dies


> -----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