|
@@ -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]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|