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 325d9cc89c
commit 13b48993b2
2 changed files with 4 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ import org.springframework.util.Assert;
* </p>
*
* @author Mark Paluch
* @author Meng Zuozhu
* @since 2.2
*/
public class Between extends AbstractSegment implements Condition {
@@ -92,6 +93,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>}.
* </p>
* @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;
}
}