In JPQL you should use SQL syntax (for the most part) meaning that !=
is expressed with <>
. See also this wiki article
Spring Data JPA / OpenJPA: Is there an equivalent to SQL !=-Operator
سؤال
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.
المحلول
لا تنتمي إلى StackOverflow