Browse Source

Use strict types instead of var

pull/12/head
Kristijan Mitrovic 4 years ago
parent
commit
8c51e41bfe
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      wizard-server/src/main/java/org/cobbzilla/wizard/dao/AbstractCRUDDAO.java

+ 4
- 4
wizard-server/src/main/java/org/cobbzilla/wizard/dao/AbstractCRUDDAO.java View File

@@ -302,13 +302,13 @@ public abstract class AbstractCRUDDAO<E extends Identifiable>
+ " SET " + String.join(" IS NULL, ", setFields) + " IS NULL" + " SET " + String.join(" IS NULL, ", setFields) + " IS NULL"
+ whereClause); + whereClause);
} else { } else {
final var setFieldsSQLPart = Arrays.stream(setFields)
.map(s -> s + (s == null ? " IS NULL" : " = :" + s))
.collect(Collectors.joining(", "));
final String setFieldsSQLPart = Arrays.stream(setFields)
.map(s -> s + (s == null ? " IS NULL" : " = :" + s))
.collect(Collectors.joining(", "));
queryBase = session.createQuery("UPDATE " + getEntityClass().getSimpleName() queryBase = session.createQuery("UPDATE " + getEntityClass().getSimpleName()
+ " SET " + setFieldsSQLPart + " SET " + setFieldsSQLPart
+ whereClause); + whereClause);
for (var i = 0; i < setValues.length; i++) {
for (int i = 0; i < setValues.length; i++) {
if (setValues[i] != null) queryBase.setParameter(setFields[i], setValues[i]); if (setValues[i] != null) queryBase.setParameter(setFields[i], setValues[i]);
} }
} }


Loading…
Cancel
Save