开发者

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

开发者 https://www.devze.com 2023-02-18 22:21 出处:网络
In a JPQL query I tried to concatenate a string with a integer, using CONCAT JPQL function, in a select clause, for example:

In a JPQL query I tried to concatenate a string with a integer, using 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.

Can we only use String in CONCAT 开发者_开发技巧function?


CONCAT is meant for Strings, the result of calling it with a number would most likely depend on your database.

You could try converting the id to a char first, you could use the FUNC function in EclipseLink to call a native function in your database that converts from numeric to char.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号