我现在正在探索用于创建动态查询和类型安全查询的 JPA Criteria API。我正在探索如何使用规范。当我探索时,我发现该toPredicate()
方法用于为实体引用的查询创建 where 子句。还探索了 And/Or/Not 以及规范中的位置。
实际上,如果toPredicate()
mMethod 创建 where 子句,那么为什么我们使用方法“Where”?比较方法时其他方法的作用是什么toPredicate()
?
我现在正在探索用于创建动态查询和类型安全查询的 JPA Criteria API。我正在探索如何使用规范。当我探索时,我发现该toPredicate()
方法用于为实体引用的查询创建 where 子句。还探索了 And/Or/Not 以及规范中的位置。
实际上,如果toPredicate()
mMethod 创建 where 子句,那么为什么我们使用方法“Where”?比较方法时其他方法的作用是什么toPredicate()
?