Hi Hibernate/JPA gurus,
I am struggling to find a way using which I can get concatenate the values of a particular column from multiple rows as one comma separated String. If anyone can tell me a solution to it, it will give me a hell lot of a relief because it has become an obstacle for me.
I am using Entity Beans (3.0) with a hibernate 3 dialect and underlying DB is MySQL.
Example:
if my table has a column name with values
machine_id os_name 1 Mac 1 Windows 1 DOS 2 Mac 2 Windows
then I want the value returned by my JPA query as
1 'Mac,Windows,DOS' 2 'Mac,Windows'
I don't want to use native SQL. I have been searching for it since many days but couldn't locate it in any of the hibernate forum topics. Please let me know if any other information is required to make my problem clear to you.
Thanks a lot in advance.
|