public class DefaultModelContext extends java.lang.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(java.util.Collection<ModelWrapper> wrappers)
Clear context after save with generic DAO
|
void |
afterDirectPersist(ModelWrapper wr)
Clear context after save with generic DAO
|
void |
afterPersist(java.util.Collection<ModelWrapper> saved) |
void |
attach(java.lang.Object model,
java.lang.Object source,
ModelConverter conv)
Attaches a new model to the context.
|
void |
clear()
Removes all attached models.
|
protected java.lang.Object |
convertKey(java.lang.Object key)
Deprecated.
since ages
|
void |
detach(java.lang.Object model,
java.lang.Object source,
ModelConverter conv)
Removes a model from context.
|
java.lang.Object |
getAttached(java.lang.Object source,
ModelConverter conv)
Returns a attached model for a given source element and converter.
|
java.util.Set<java.lang.Object> |
getModified()
Returns all attached model instances which are currently modified.
|
java.util.Set<java.lang.Object> |
getNew()
Returns all attached model instances which are currently new.
|
java.lang.String |
getStats() |
boolean |
isAttached(java.lang.Object model,
ModelConverter conv)
|
protected void |
modificationStatusChanged(java.lang.Object model,
ModelConverter conv) |
protected java.lang.Object |
unwrapKey(java.lang.Object key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearLoading, isLoading, markLoadingpublic boolean isAttached(java.lang.Object model,
ModelConverter conv)
ModelContextisAttached in interface ModelContextfalse otherwise.public void afterPersist(java.util.Collection<ModelWrapper> saved)
afterPersist in interface ModelContextpublic void afterDirectPersist(java.util.Collection<ModelWrapper> wrappers)
ModelContextafterDirectPersist in interface ModelContextpublic void afterDirectPersist(ModelWrapper wr)
ModelContextafterDirectPersist in interface ModelContextprotected void modificationStatusChanged(java.lang.Object model,
ModelConverter conv)
public java.lang.String getStats()
public void attach(java.lang.Object model,
java.lang.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 java.lang.Object convertKey(java.lang.Object key)
unwrapKey(Object) instead
deprecated @since 5.0protected java.lang.Object unwrapKey(java.lang.Object key)
public void detach(java.lang.Object model,
java.lang.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 java.lang.Object getAttached(java.lang.Object source,
ModelConverter conv)
ModelContextgetAttached in interface ModelContextsource - the source element - must not be nullconv - the converterpublic void clear()
ModelContextclear in interface ModelContextpublic java.util.Set<java.lang.Object> getNew()
ModelContextgetNew in interface ModelContextpublic java.util.Set<java.lang.Object> getModified()
ModelContextgetModified in interface ModelContextCopyright © 2018 SAP SE. All Rights Reserved.