Package io.jmix.flowui.model.impl
Interface DataContextInternal
- All Superinterfaces:
DataContext,DataContextChanges
- All Known Implementing Classes:
DataContextImpl
Marker interface of
DataContext implementations that can form hierarchies
using DataContext.setParent(DataContext).-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.model.DataContext
DataContext.ChangeEvent, DataContext.PostSaveEvent, DataContext.PreSaveEvent -
Method Summary
Methods inherited from interface io.jmix.flowui.model.DataContext
addChangeListener, addPostSaveListener, addPreSaveListener, clear, clearChanges, contains, create, evict, evictModified, find, find, getModified, getModifiedAttributes, getParent, getRemoved, getSaveDelegate, hasChanges, isModified, isRemoved, merge, merge, merge, merge, remove, save, save, setModified, setParent, setSaveDelegateMethods inherited from interface io.jmix.flowui.model.DataContextChanges
getModifiedInstances, getRemovedInstances
-
Method Details
-
mergeFromChild
Merges an entity saved by a child context into this (parent) context.Unlike a plain
DataContext.merge(Object), the child's dirty attributes override this context's own unsaved edits of the same attributes (the child's later intent wins), and are then registered as dirty here so the parent's eventual save carries them.- Parameters:
entity- the entity instance saved by the child contextchildDirtyAttributes- attributes the child tracked as changed for this entity- Returns:
- the managed instance of this context
-
mergeCompositionOwnerFromChild
Merges an entity owning a composition child that a child context saved into this (parent) context.Unlike a plain
DataContext.merge(Object), the owner is also marked as changed forDataContext.isModified(Object), so a reopened editor of the owner keeps this context's instance instead of reloading a stale copy. The owner does not enterDataContext.getModified()and is never persisted on its own.- Parameters:
owner- the owner instance of the child context- Returns:
- the managed instance of this context
-