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 classUniqueAttributesInterceptor.AmbiguousUniqueKeysExceptionstatic classUniqueAttributesInterceptor.NonSearchableAttributeExceptionstatic classUniqueAttributesInterceptor.UniqueAttributeInterceptorExceptionprotected static classUniqueAttributesInterceptor.UniqueItem
-
Constructor Summary
Constructors Constructor Description UniqueAttributesInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GenericQuerycreateGenericQuery(UniqueAttributesInterceptor.UniqueItem item)protected java.util.Collection<UniqueAttributesInterceptor.UniqueItem>getModifiedUniqueItemModels(InterceptorContext ctx)TypeServicegetTypeService()voidonValidate(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetTypeService(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 InterceptorExceptionDescription 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
protected GenericQuery createGenericQuery(UniqueAttributesInterceptor.UniqueItem item)
-
getModifiedUniqueItemModels
protected java.util.Collection<UniqueAttributesInterceptor.UniqueItem> getModifiedUniqueItemModels(InterceptorContext ctx) throws InterceptorException
- Throws:
InterceptorException
-
-