Closed
Description
The below code generates the query as 'SELECT department.* FROM department' ; instead of 'SELECT department.* FROM department WHERE NOT (department.department_id = 1 AND department.department_id = 2)'
The where clause is being ignored
Select select = StatementBuilder.select(department.asterisk()).from(department). where(
Conditions.nest(department.column("department_id").isEqualTo(Expressions.just("1"))
.and(department.column("department_id").isEqualTo(Expressions.just("2")))).not()).build();
String sql = SqlRenderer.toString(select);
System.out.println(sql);
However if I remove the not() condition, the query renders fine as 'SELECT department.* FROM department WHERE (department.department_id = 1 AND department.department_id = 2)'
Select select = StatementBuilder.select(department.asterisk()).from(department).where(
Conditions.nest(department.column("department_id").isEqualTo(Expressions.just("1"))
.and(department.column("department_id").isEqualTo(Expressions.just("2"))))).build();
String sql = SqlRenderer.toString(select);
System.out.println(sql);