Refactor, add db clean script

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-08-26 10:32:48 +02:00
parent 171f96f309
commit f3534bc4d9
3 changed files with 6 additions and 11 deletions

View File

@@ -8,13 +8,8 @@
*/
package org.eclipse.hawkbit.repository.exception;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
import org.eclipse.hawkbit.exception.SpServerError;
@@ -49,12 +44,10 @@ public class ConstraintViolationException extends AbstractServerRtException {
* @return message String with proper error information
*/
public static String getExceptionMessage(final javax.validation.ConstraintViolationException ex) {
final Set<ConstraintViolation<?>> violations = ex.getConstraintViolations();
final List<String> messages = new ArrayList<>();
violations.stream().forEach(
violation -> messages.add(violation.getPropertyPath() + MESSAGE_FORMATTER_SEPARATOR + violation.getMessage() + "."));
return messages.stream().collect(Collectors.joining(MESSAGE_FORMATTER_SEPARATOR));
return ex
.getConstraintViolations().stream().map(violation -> violation.getPropertyPath()
+ MESSAGE_FORMATTER_SEPARATOR + violation.getMessage() + ".")
.collect(Collectors.joining(MESSAGE_FORMATTER_SEPARATOR));
}
}

View File

@@ -0,0 +1 @@
Update sp_software_module_type set max_ds_assignments = 1 where max_ds_assignments < 1;

View File

@@ -0,0 +1 @@
Update sp_software_module_type set max_ds_assignments = 1 where max_ds_assignments < 1;