Skip to content

Commit 7043d8a

Browse files
committed
Making the intent clearer
1 parent 0b76b37 commit 7043d8a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/org/apache/ibatis/mapping/ParameterMapping.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828
public class ParameterMapping {
2929

30+
private static Object UNSET = new Object();
3031
private Configuration configuration;
3132

3233
private String property;
@@ -38,8 +39,7 @@ public class ParameterMapping {
3839
private String resultMapId;
3940
private String jdbcTypeName;
4041
private String expression;
41-
private Object value;
42-
private boolean hasValue;
42+
private Object value = UNSET;
4343

4444
private ParameterMapping() {
4545
}
@@ -103,7 +103,6 @@ public Builder expression(String expression) {
103103

104104
public Builder value(Object value) {
105105
parameterMapping.value = value;
106-
parameterMapping.hasValue = true;
107106
return this;
108107
}
109108

@@ -218,7 +217,7 @@ public Object getValue() {
218217
}
219218

220219
public boolean hasValue() {
221-
return hasValue;
220+
return value != UNSET;
222221
}
223222

224223
@Override

0 commit comments

Comments
 (0)