Hibernate にはこの構文がないように見えますが、そうですか?
public int MaxIdenx() {
int max = 0;
String hql = "select ifnull(max(empId),0)from Emp";
Query query = session.createQuery(hql);
List currentSeq = query.list();
if (currentSeq == null) {
return max;
} else {
max = (Integer) currentSeq.get(0);
return max + 1;
}
}