public interface ModelContext
| Modifier and Type | Field and Description |
|---|---|
static ThreadLocal<Vector<PK>> |
loading |
| 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> models) |
void |
attach(Object model,
Object source,
ModelConverter conv)
Attaches a new model to the context.
|
void |
clear()
Removes all attached models.
|
default void |
clearLoading(PersistenceObject source) |
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.
|
boolean |
isAttached(Object model,
ModelConverter conv)
|
default boolean |
isLoading(PersistenceObject source) |
default void |
markLoading(PersistenceObject source) |
static final ThreadLocal<Vector<PK>> loading
void afterPersist(Collection<ModelWrapper> models)
void attach(Object model, Object source, ModelConverter conv)
model - the model to holdsource - the source element - may be null for new modelsconv - the converter usedIllegalStateException - if there is a existing model mapped to the same source and convertervoid detach(Object model, Object source, ModelConverter conv)
model - the model to removesource - its source - may be null for new modelsconv - the converter which manages the modelObject getAttached(Object source, ModelConverter conv)
source - the source element - must not be nullconv - the converterboolean isAttached(Object model, ModelConverter conv)
false otherwise.void clear()
Set<Object> getModified()
void afterDirectPersist(Collection<ModelWrapper> wrappers)
void afterDirectPersist(ModelWrapper wr)
default boolean isLoading(PersistenceObject source)
default void markLoading(PersistenceObject source)
default void clearLoading(PersistenceObject source)
Copyright © 2017 SAP SE. All Rights Reserved.