如何在(Open)JPA下进行group_concat?

时间:2014-01-28 10:46:41

标签: java mysql jpa openjpa spring-data-jpa

是否有可能在JPA下执行group_concat()? 我有以下声明:

# 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
;

有没有办法将其转换为JPA-Query?

我正在使用Spring-Data-JPA和OpenJPA。有没有可能的方法(除了本机查询)?

0 个答案:

没有答案