
java.lang.IllegalArgumentException: Error occurred validating the Criteria
。。。
Caused by: java.lang.IllegalStateException: No explicit selection and an implicit one could not be determined
使用JPA的Criteria進行安全類型的查詢分頁數據,執行拋出: No explicit selection and an implicit one could not be determined 異常,原因是使用CriteriaBuilder.createTupleQuery進行查詢,沒有置頂查詢的結果集的列,需要使用 query.multiselect明確指定返回的列