File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/java/org/mybatis/dynamic/sql/insert Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2020 the original author or authors.
2
+ * Copyright 2016-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
29
29
import org .mybatis .dynamic .sql .util .NullMapping ;
30
30
import org .mybatis .dynamic .sql .util .StringConstantMapping ;
31
31
import org .mybatis .dynamic .sql .util .ValueMapping ;
32
+ import org .mybatis .dynamic .sql .util .ValueOrNullMapping ;
32
33
import org .mybatis .dynamic .sql .util .ValueWhenPresentMapping ;
33
34
34
35
public class GeneralInsertDSL implements Buildable <GeneralInsertModel > {
@@ -88,6 +89,15 @@ public GeneralInsertDSL toValue(Supplier<T> valueSupplier) {
88
89
return GeneralInsertDSL .this ;
89
90
}
90
91
92
+ public GeneralInsertDSL toValueOrNull (T value ) {
93
+ return toValueOrNull (() -> value );
94
+ }
95
+
96
+ public GeneralInsertDSL toValueOrNull (Supplier <T > valueSupplier ) {
97
+ insertMappings .add (ValueOrNullMapping .of (column , valueSupplier ));
98
+ return GeneralInsertDSL .this ;
99
+ }
100
+
91
101
public GeneralInsertDSL toValueWhenPresent (T value ) {
92
102
return toValueWhenPresent (() -> value );
93
103
}
You can’t perform that action at this time.
0 commit comments