public class DefaultModelContext extends Object implements ModelContext
HybrisRequestScope. Any other scope could lead to memory problems since models are held forever (until scope
dies)!loading| Constructor and Description |
|---|
DefaultModelContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterDirectPersist(Collection<ModelWrapper> wrappers)
Clear context after save with generic DAO
|
void |
afterDirectPersist(ModelWrapper wr)
Clear context after save with generic DAO
|
void |
afterPersist(Collection<ModelWrapper> saved) |
void |
attach(Object model,
Object source,
ModelConverter conv)
Attaches a new model to the context.
|
void |
clear()
Removes all attached models.
|
protected Object |
convertKey(Object key)
Deprecated.
|
void |
detach(Object model,
Object source,
ModelConverter conv)
Removes a model from context.
|
Object |
getAttached(Object source,
ModelConverter conv)
Returns a attached model for a given source element and converter.
|
Set<Object> |
getModified()
Returns all attached model instances which are currently modified.
|
Set<Object> |
getNew()
Returns all attached model instances which are currently new.
|
String |
getStats() |
boolean |
isAttached(Object model,
ModelConverter conv)
|
protected void |
modificationStatusChanged(Object model,
ModelConverter conv) |
protected Object |
unwrapKey(Object key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearLoading, isLoading, markLoadingpublic boolean isAttached(Object model, ModelConverter conv)
ModelContextisAttached in interface ModelContextfalse otherwise.public void afterPersist(Collection<ModelWrapper> saved)
afterPersist in interface ModelContextpublic void afterDirectPersist(Collection<ModelWrapper> wrappers)
ModelContextafterDirectPersist in interface ModelContextpublic void afterDirectPersist(ModelWrapper wr)
ModelContextafterDirectPersist in interface ModelContextprotected void modificationStatusChanged(Object model, ModelConverter conv)
public String getStats()
public void attach(Object model, Object source, ModelConverter conv)
ModelContextattach in interface ModelContextmodel - the model to holdsource - the source element - may be null for new modelsconv - the converter used@Deprecated protected Object convertKey(Object key)
unwrapKey(Object) instead
deprecated @since 5.0public void detach(Object model, Object source, ModelConverter conv)
ModelContextdetach in interface ModelContextmodel - the model to removesource - its source - may be null for new modelsconv - the converter which manages the modelpublic Object getAttached(Object source, ModelConverter conv)
ModelContextgetAttached in interface ModelContextsource - the source element - must not be nullconv - the converterpublic void clear()
ModelContextclear in interface ModelContextpublic Set<Object> getNew()
ModelContextgetNew in interface ModelContextpublic Set<Object> getModified()
ModelContextgetModified in interface ModelContextCopyright © 2017 SAP SE. All Rights Reserved.