The generated SQL query seems correct. I guess the parenthesis are confusing you, but if you think about the precedence of the AND predicate, the generated where predicate is semantically equivalent to the one of the HQL.