下面的第一个查询如何在传递值3的Enum时返回期望值,但是第二个查询没有返回相同的值。
OR的哪一方在哪个顺序有关系吗?
@Query("SELECT g " +
"FROM goal g " +
"WHERE g.companyId = ?1 " +
"AND (?2 IS NULL OR g.archived = ?2) " +
-----> "AND (g.type = ?3 OR ?3 IS NULL) ")
@Query("SELECT g " +
"FROM goal g " +
"WHERE g.companyId = ?1 " +
"AND (?2 IS NULL OR g.archived = ?2) " +
-----> "AND (?3 IS NULL OR g.type = ?3) ")