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

笑着哭i 提交于 2019-12-10 17:44:04

问题


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?

Thanks in advance.


回答1:


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.



来源:https://stackoverflow.com/questions/5363113/jpql-we-cant-concatstring-integer-eclipselink

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!