2

Is there any possibility to do group_concat() under JPA? I have the following statement:

# Pseudoquery
SELECT
    t0.id,
    MAX(t0.created),
    GROUP_CONCAT(t3.id),
    MIN(t2.created),
    GROUP_CONCAT(DISTINCT t2.createdby)
FROM
    t0
JOIN
    t1 ON t0.id = t1.id
JOIN
    t2 ON t2.id = t0.oid
JOIN
    t3 ON t3.oid = t2.oid
WHERE
    t1.created BETWEEN DATE_SUB(NOW(), INTERVAL 60 DAY) AND NOW() AND
    t3.id LIKE 'L%'
GROUP BY
    t0.id
;

Is there any way to transform this to a JPA-Query?

I'm using Spring-Data-JPA together with OpenJPA. Is there a possible way (besides a native Query)?

Thomas Junk
  • 5,588
  • 2
  • 30
  • 43

0 Answers0