Search code examples
javahibernatehql

What Exactly does the <> operator do in HQL


It doesn't say exactly in the docs. I have seen this refer to not equals in other instances but HQL already has !=

If it does mean not equals how is it different from != ?

I'm sorry if this question has been asked before, but I wasn't able to find an exact explanation for it.


Solution

  • The SQL standard defines not equals as <>; HQL is SQL-like so follows suit.

    Some database dialects (also) support != as the not equals operator, some only support !=, others only <>; but for dialects that support both, the behaviour is the same (at least, I am not aware of dialects where they behave differently).