#1354 - ENH: Add SqlUpdate setNextParameter() ... as alternative for positioned parameters

This commit is contained in:
Rob Bygrave committed 2018-03-28 00:45:12 +13:00
1 parent 534eb2f0e2
commit cca837bcfa
4 files changed
+8 -8

No files matched your search

@@ -482,12 +482,12 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
void bindParentIds(DefaultSqlUpdate delete, List<Object> parentIds) {
if (isExportedSimple()) {
delete.addParameter(new MultiValueWrapper(parentIds));
delete.setNextParameter(new MultiValueWrapper(parentIds));
} else {
// embedded ids etc
List<Object> bindValues = flattenParentIds(parentIds);
for (Object bindValue : bindValues) {
delete.addParameter(bindValue);
delete.setNextParameter(bindValue);
}
}
}
@@ -495,12 +495,12 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
void bindParentId(DefaultSqlUpdate sqlUpd, Object parentId) {
if (isExportedSimple()) {
sqlUpd.addParameter(parentId);
sqlUpd.setNextParameter(parentId);
return;
}
EntityBean parent = (EntityBean) parentId;
for (ExportedProperty exportedProperty : exportedProperties) {
sqlUpd.addParameter(exportedProperty.getValue(parent));
sqlUpd.setNextParameter(exportedProperty.getValue(parent));
}
}