📜  休眠选择计数 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:24.245000             🧑  作者: 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();