JPQL we can't CONCAT (String, Integer) EclipseLink?

In a JPQL query, I tried to combine a string with an integer using the CONCAT JPQL function in a select clause, for example:

SELECT CONCAT(c.idClient, ' ', c.name) FROM Clients c;

But the result is not a readable string.

Is it possible to use only the String function in CONCAT?

Thanks in advance.

+3
source share
1 answer

CONCAT is for strings; the result of calling it with a number will most likely depend on your database.

First you can try to convert the identifier to char, you can use the FUNC function in EclipseLink to call your own function in your database, which converts numeric values ​​to char.

+5
source

All Articles