📜  hibernate 创建查询计数返回 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:44.765000             🧑  作者: Mango

代码示例1
// All entries
Long count = (Long) session.createQuery("select count(ALL YourTable) from YourTable yourTable").getSingleResult();

// filtered entries
Long count = (Long) session.createQuery("select count(yourTable) from YourTable yourTable where yourTable.whatever = whatever").setParameter("whatever", yourParam).getSingleResult();