java.lang.IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list
可能的原因:fetch 与 count 一起使用
select count(o) from Student s left outer join fetch o.clazz
把fetch去掉即可
select count(o) from Student s left outer join o.clazz
或
select count(o) from Student s