Class DefaultModelContext
java.lang.Object
de.hybris.platform.servicelayer.internal.model.impl.DefaultModelContext
- All Implemented Interfaces:
ModelContext
Default model context implementation. Use spring scoped proxy mechanism to bind it to
HybrisRequestScope. Any other scope could lead to memory problems since models are held forever (until scope
dies)!-
Field Summary
Fields inherited from interface de.hybris.platform.servicelayer.internal.model.ModelContext
loading -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear context after save with generic DAOvoidafterDirectPersist(Collection<ModelWrapper> wrappers) Clear context after save with generic DAOvoidafterPersist(Collection<ModelWrapper> saved) voidattach(Object model, Object source, ModelConverter conv) Attaches a new model to the context.voidclear()Removes all attached models.protected ObjectconvertKey(Object key) Deprecated, for removal: This API element is subject to removal in a future version.since agesvoiddetach(Object model, Object source, ModelConverter conv) Removes a model from context.getAttached(Object source, ModelConverter conv) Returns a attached model for a given source element and converter.Returns all attached model instances which are currently modified.getNew()Returns all attached model instances which are currently new.getStats()booleanisAttached(Object model, ModelConverter conv) protected voidmodificationStatusChanged(Object model, ModelConverter conv) protected ObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.servicelayer.internal.model.ModelContext
clearLoading, isLoading, markLoading
-
Constructor Details
-
DefaultModelContext
public DefaultModelContext()
-
-
Method Details
-
isAttached
Description copied from interface:ModelContext- Specified by:
isAttachedin interfaceModelContext- Returns:
falseotherwise.
-
afterPersist
- Specified by:
afterPersistin interfaceModelContext
-
afterDirectPersist
Description copied from interface:ModelContextClear context after save with generic DAO- Specified by:
afterDirectPersistin interfaceModelContext
-
afterDirectPersist
Description copied from interface:ModelContextClear context after save with generic DAO- Specified by:
afterDirectPersistin interfaceModelContext
-
modificationStatusChanged
-
getStats
-
attach
Description copied from interface:ModelContextAttaches a new model to the context.- Specified by:
attachin interfaceModelContext- Parameters:
model- the model to holdsource- the source element - may be null for new modelsconv- the converter used
-
convertKey
Deprecated, for removal: This API element is subject to removal in a future version.since agesUseunwrapKey(Object)insteaddeprecated @since 5.0
-
unwrapKey
-
detach
Description copied from interface:ModelContextRemoves a model from context.- Specified by:
detachin interfaceModelContext- Parameters:
model- the model to removesource- its source - may be null for new modelsconv- the converter which manages the model
-
getAttached
Description copied from interface:ModelContextReturns a attached model for a given source element and converter.- Specified by:
getAttachedin interfaceModelContext- Parameters:
source- the source element - must not be nullconv- the converter
-
clear
public void clear()Description copied from interface:ModelContextRemoves all attached models.- Specified by:
clearin interfaceModelContext
-
getNew
Description copied from interface:ModelContextReturns all attached model instances which are currently new.- Specified by:
getNewin interfaceModelContext
-
getModified
Description copied from interface:ModelContextReturns all attached model instances which are currently modified.- Specified by:
getModifiedin interfaceModelContext
-