如何为以下SQL查询建立休眠条件

时间:2018-06-22 08:04:18

标签: hibernate-criteria

如何将以下sql查询转换为休眠条件查询:

SELECT t.*, COUNT(b.id)
FROM tags t LEFT JOIN books_tags bt ON t.id = bt.tag_id
LEFT JOIN (books b, authors_books ab, authors a) ON b.id = bt.book_id AND b.id = ab.book_id AND ab.author_id = a.id AND a.name = ‘F. Scott Fitzgerald’ AND b.is_unread = 0
WHERE 1
GROUP BY t.id;

0 个答案:

没有答案