Class UniqueAttributesInterceptor
java.lang.Object
de.hybris.platform.servicelayer.interceptor.impl.LocalizedMessageAwareValidator
de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor
public class UniqueAttributesInterceptor
extends LocalizedMessageAwareValidator
implements ValidateInterceptor
Validates for any Model if the unique keys for this model are unique in the database. Throws different
InterceptorExceptions if the unique constraint is violated.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classprotected static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected GenericQueryprotected Collection<UniqueAttributesInterceptor.UniqueItem>voidinit()voidonValidate(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.protected voidvoidsetTypeService(TypeService typeService) Methods inherited from class de.hybris.platform.servicelayer.interceptor.impl.LocalizedMessageAwareValidator
getLocalizedMessage, setL10nService
-
Field Details
-
DB_INDEX_ENABLED
- See Also:
-
-
Constructor Details
-
UniqueAttributesInterceptor
public UniqueAttributesInterceptor()
-
-
Method Details
-
getTypeService
-
setTypeService
-
onValidate
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor- Parameters:
model- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
createGenericQuery
-
getModifiedUniqueItemModels
protected Collection<UniqueAttributesInterceptor.UniqueItem> getModifiedUniqueItemModels(InterceptorContext ctx) throws InterceptorException - Throws:
InterceptorException
-
registerTenantListener
protected void registerTenantListener() -
init
@PostConstruct public void init()
-