Skip to content

Fix 'negated like' and 'negated between' for toString method #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Results in a rendered condition: {@code <left> BETWEEN <begin> AND <end>}.
*
* @author Mark Paluch
* @author Meng Zuozhu
* @since 2.2
*/
public class Between extends AbstractSegment implements Condition {
Expand Down Expand Up @@ -91,6 +92,6 @@ public Between not() {

@Override
public String toString() {
return column + " BETWEEN " + begin + " AND " + end;
return column + (negated ? " NOT" : "") + " BETWEEN " + begin + " AND " + end;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Results in a rendered condition: {@code <left> LIKE <right>}.
*
* @author Mark Paluch
* @author Meng Zuozhu
* @since 1.1
*/
public class Like extends AbstractSegment implements Condition {
Expand Down Expand Up @@ -80,6 +81,6 @@ public Like not() {

@Override
public String toString() {
return left + " LIKE " + right;
return left + (negated ? " NOT" : "") + " LIKE " + right;
}
}