JPQL allows Concat TO NULL

I need help, I work with Eclipse-Link 2.4 (newer), well I have some JPQL functions with CONCAT string function and I use Instruccion

SELECT NEW test.Routing(r.idOperacion, CONCAT(r.reference, 'Test') ) FROM Routing r; 

It's harder, but I cut JPQL a bit, this is a problem

Solves CONCAT(r.reference, 'Test') as Boolean and says that there is no constructor of type Routing(Strnig, Boolean) , because it is not there, only take 2 lines, this happens, since I update my eclipse from glass fish.

+4
source share
1 answer

You found a bug in EclipseLink 2.4. A query is a syntactically valid JQPL query, and it works, for example, in EclipseLink 2.3.3.

A workaround is to invoke the CONCAT database function using FUNC :

 SELECT NEW test.Routing(r.idOperacion, FUNC('CONCAT', r.reference, 'Test') ) FROM Routing r; 

What else can you do is a file with an error and rollback to version 2.3.3, if the functions presented in 2.4 are not needed.

+3
source

All Articles