Fix toString for negated conditions.

Original pull request #1193
This commit is contained in:
Meng Zuozhu
2022-03-08 20:48:23 +08:00
committed by Jens Schauder
parent b4d3838d65
commit bfba4222f8
2 changed files with 4 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.util.Assert;
* 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 {
@@ -91,6 +92,6 @@ public class Between extends AbstractSegment implements Condition {
@Override
public String toString() {
return column + " BETWEEN " + begin + " AND " + end;
return column + (negated ? " NOT" : "") + " BETWEEN " + begin + " AND " + end;
}
}

View File

@@ -23,6 +23,7 @@ import org.springframework.util.Assert;
* 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 {
@@ -80,6 +81,6 @@ public class Like extends AbstractSegment implements Condition {
@Override
public String toString() {
return left + " LIKE " + right;
return left + (negated ? " NOT" : "") + " LIKE " + right;
}
}