문제

Is there an equivalent to the native sql !=-operator for Spring Data JPA @Query-Annotation using OpenJPA? So i thought it would work somewhat like this:

@Query("select a from TableA a, TableB b where a.property != b.property")

but it doesn't, or lets say at least my ide (intellij) shows me that it does not know how to work with '!='.

The (as i thought) corresponding

@Query("select a from TableA, TableB b where a.property = b.property")

works.

도움이 되었습니까?

해결책

In JPQL you should use SQL syntax (for the most part) meaning that != is expressed with <>. See also this wiki article

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top