GROUP_CONCAT Hibernate HQL

2019-07-24 11:24发布

Basically i am trying to write the following query in Hibernate. Please help me to do the same.

SELECT collaboratoruser,GROUP_CONCAT(collaboratorrole SEPARATOR ',') FROM tbl_conceptcollections_collaborator WHERE collectionid = incollectionid GROUP BY collaboratoruser;

I cannot use SQL Query and i want to use only HQL. Any help appreciated.

1条回答
Viruses.
2楼-- · 2019-07-24 11:54

Frank answer is No.

Why so ?

Hibernate supports only common function/syntax used in multiple database's. Moreover, There isn't any group_concat function in MySQL Server and probably could be the same for other database as well.

Solution:

You have to execute it as Native SQL Query only.

查看更多
登录 后发表回答