File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
doma-core/src/main/java/org/seasar/doma/jdbc/query Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ public UpsertAssemblerContext(
5050 "duplicateKeyType" ,
5151 "The duplicateKeyType must not be set to EXCEPTION when performing an upsert." );
5252 }
53+ if (keys .isEmpty ()) {
54+ throw new DomaIllegalArgumentException (
55+ "keys" ,
56+ "The keys must not be empty when performing an upsert. At least one key must be specified." );
57+ }
58+ if (duplicateKeyType == DuplicateKeyType .UPDATE && setValues .isEmpty ()) {
59+ throw new DomaIllegalArgumentException (
60+ "setValues" ,
61+ "The setValues must not be empty when performing an upsert with the UPDATE duplicateKeyType. At least one set value must be specified." );
62+ }
5363 this .buf = buf ;
5464 this .entityType = entityType ;
5565 this .duplicateKeyType = duplicateKeyType ;
You can’t perform that action at this time.
0 commit comments