Skip to content
Snippets Groups Projects
Verified Commit 6a062dd4 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-7473 validate aggregation mapping before save

Sub task: OZG-7933
parent 75605575
No related branches found
No related tags found
1 merge request!10OZG-7473 add validation messages and change collection
......@@ -34,9 +34,12 @@ import de.ozgcloud.admin.common.DelegatingValidatorAdapter;
@Configuration
public class AdministrationRepositoryRestConfigurer implements RepositoryRestConfigurer {
private static final DelegatingValidatorAdapter DELEGATING_VALIDATOR_ADAPTER = new DelegatingValidatorAdapter(
Validation.buildDefaultValidatorFactory().getValidator());
@Override
public void configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener listener) {
var validator = Validation.buildDefaultValidatorFactory().getValidator();
listener.addValidator("beforeCreate", new DelegatingValidatorAdapter(validator));
listener.addValidator("beforeCreate", DELEGATING_VALIDATOR_ADAPTER);
listener.addValidator("beforeSave", DELEGATING_VALIDATOR_ADAPTER);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment