querydsl spring data jpa运算符优先级

lab*_*jee 5 java hibernate jpa spring-data-jpa

public interface ItemRepository extends JpaRepository<Item, Integer> {
   List<Item> findByNameAndDescriptionIsNullOrDescription(String name, String desc); 
 }
Run Code Online (Sandbox Code Playgroud)

在本机Query中,where条件findByNameAndDescriptionIsNullOrDescription被转换为

where item0_.NAME=? and (item0_.DESC is null) or item0_.DESC=? 
Run Code Online (Sandbox Code Playgroud)

我需要 where item0_.NAME=? and (item0_.DESC is null or item0_.DESC=?)

我使用以下内容

  • 弹簧数据公地1.6.3.RELEASE.jar

  • 弹簧数据JPA-1.4.3.RELEASE.jar

  • (i)hibernate-entitymanager-4.2.14.SP1-redhat-1.jar,(ii)hibernate-jpa-2.0-api-1.0.1.Final-redhat-2.jar由JBOSS EAP 6.3提供

Ore*_*est 4

也许你不能这样做。

Spring Data querydsl 仅用于简单的 SQL 查询,如果您需要更复杂的内容,请使用@Query注释。

其他开发人员也可以更轻松地理解您使用的查询,而不是分析您的方法名称。