Class OrphanedPartOfCleanupPrepareInterceptor
java.lang.Object
de.hybris.platform.servicelayer.interceptor.impl.OrphanedPartOfCleanupPrepareInterceptor
- All Implemented Interfaces:
Interceptor,PrepareInterceptor
Registers orphaned partOf members for removal. Fixes a performance issue in the original interceptor. The original
loads the value of every partof attribute even if the value has not been changed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CollectioncollectItemsToRemove(Object originalValue, Object currentValue) protected ObjectgetAttributeValue(InterceptorContext ctx, AbstractItemModel model, String qualifier) protected ObjectgetAttributeValue(InterceptorContext ctx, AbstractItemModel model, String qualifier, Locale loc) protected ObjectgetOriginalValue(AbstractItemModel model, String partOfQualifier) protected ObjectgetOriginalValue(AbstractItemModel model, String partOfQualifier, Locale loc) getWritablePartOfAttributes(InterceptorContext ctx, String itemType) protected booleanisModifiedItemUsingSLD(Object object, InterceptorContext ctx) voidonPrepare(Object object, InterceptorContext ctx) Called in themodelService.saveAll()method.protected voidregisterForRemoval(Collection items, InterceptorContext ctx) protected voidregisterForRemovalIfNecessary(InterceptorContext ctx, Object currentValue, Object originalValue) voidsetTypeService(TypeService typeService)
-
Constructor Details
-
OrphanedPartOfCleanupPrepareInterceptor
public OrphanedPartOfCleanupPrepareInterceptor()
-
-
Method Details
-
onPrepare
Description copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor- Parameters:
object- the model which values has to be preparedctx- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
getWritablePartOfAttributes
-
registerForRemovalIfNecessary
protected void registerForRemovalIfNecessary(InterceptorContext ctx, Object currentValue, Object originalValue) -
isModifiedItemUsingSLD
-
registerForRemoval
-
collectItemsToRemove
-
getOriginalValue
-
getOriginalValue
-
getAttributeValue
protected Object getAttributeValue(InterceptorContext ctx, AbstractItemModel model, String qualifier) -
getAttributeValue
protected Object getAttributeValue(InterceptorContext ctx, AbstractItemModel model, String qualifier, Locale loc) -
setTypeService
-