Interface ModelContext
- All Known Implementing Classes:
DefaultModelContext,ModelContextProxy
public interface ModelContext
Collects all loaded, created or attached model instances managed by model service.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidClear context after save with generic DAOvoidafterDirectPersist(Collection<ModelWrapper> wrappers) Clear context after save with generic DAOvoidafterPersist(Collection<ModelWrapper> models) voidattach(Object model, Object source, ModelConverter conv) Attaches a new model to the context.voidclear()Removes all attached models.default voidclearLoading(PersistenceObject source) voiddetach(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.booleanisAttached(Object model, ModelConverter conv) default booleanisLoading(PersistenceObject source) default voidmarkLoading(PersistenceObject source)
-
Field Details
-
loading
-
-
Method Details
-
afterPersist
-
attach
Attaches a new model to the context.- Parameters:
model- the model to holdsource- the source element - may be null for new modelsconv- the converter used- Throws:
IllegalStateException- if there is a existing model mapped to the same source and converter
-
detach
Removes a model from context.- Parameters:
model- the model to removesource- its source - may be null for new modelsconv- the converter which manages the model
-
getAttached
Returns a attached model for a given source element and converter.- Parameters:
source- the source element - must not be nullconv- the converter
-
isAttached
- Returns:
falseotherwise.
-
clear
void clear()Removes all attached models. -
getNew
Returns all attached model instances which are currently new. -
getModified
Returns all attached model instances which are currently modified. -
afterDirectPersist
Clear context after save with generic DAO -
afterDirectPersist
Clear context after save with generic DAO -
isLoading
-
markLoading
-
clearLoading
-