其他分享
首页 > 其他分享> > jpa CriteriaQueryNo explicit selection and an implicit one could not be determined

jpa CriteriaQueryNo explicit selection and an implicit one could not be determined

作者:互联网

java.lang.IllegalArgumentException: Error occurred validating the Criteria
    。。。
Caused by: java.lang.IllegalStateException: No explicit selection and an implicit one could not be determined
View Code

使用JPA的Criteria进行安全类型的查询分页数据,执行抛出: No explicit selection and an implicit one could not be determined 异常,原因是使用CriteriaBuilder.createTupleQuery进行查询,没有置顶查询的结果集的列,需要使用 query.multiselect明确指定返回的列

标签:selection,jpa,could,explicit,查询,determined,implicit
来源: https://www.cnblogs.com/XingXiaoMeng/p/11518748.html