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 Classes Modifier and Type Class Description static class
UniqueAttributesInterceptor.AmbiguousUniqueKeysException
static class
UniqueAttributesInterceptor.NonSearchableAttributeException
static class
UniqueAttributesInterceptor.UniqueAttributeInterceptorException
protected static class
UniqueAttributesInterceptor.UniqueItem
-
Constructor Summary
Constructors Constructor Description UniqueAttributesInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GenericQuery
createGenericQuery(UniqueAttributesInterceptor.UniqueItem item)
protected java.util.Collection<UniqueAttributesInterceptor.UniqueItem>
getModifiedUniqueItemModels(InterceptorContext ctx)
TypeService
getTypeService()
void
onValidate(java.lang.Object model, InterceptorContext ctx)
Called in themodelService.saveAll()
method.void
setTypeService(TypeService typeService)
-
Methods inherited from class de.hybris.platform.servicelayer.interceptor.impl.LocalizedMessageAwareValidator
getLocalizedMessage, setL10nService
-
-
-
-
Method Detail
-
getTypeService
public TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
onValidate
public void onValidate(java.lang.Object model, InterceptorContext ctx) throws InterceptorException
Description copied from interface:ValidateInterceptor
Called in themodelService.saveAll()
method. Validates the values of the given model.- Specified by:
onValidate
in interfaceValidateInterceptor
- Parameters:
model
- the model which values has to be validatedctx
- theInterceptorContext
- Throws:
InterceptorException
- if any values of the model are not valid.
-
createGenericQuery
protected GenericQuery createGenericQuery(UniqueAttributesInterceptor.UniqueItem item)
-
getModifiedUniqueItemModels
protected java.util.Collection<UniqueAttributesInterceptor.UniqueItem> getModifiedUniqueItemModels(InterceptorContext ctx) throws InterceptorException
- Throws:
InterceptorException
-
-