Interface DataContextInternal

All Superinterfaces:
DataContext, DataContextChanges
All Known Implementing Classes:
DataContextImpl

@NullMarked public interface DataContextInternal extends DataContext, DataContextChanges
Marker interface of DataContext implementations that can form hierarchies using DataContext.setParent(DataContext).
  • Method Details

    • mergeFromChild

      default Object mergeFromChild(Object entity, Set<String> childDirtyAttributes)
      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 context
      childDirtyAttributes - attributes the child tracked as changed for this entity
      Returns:
      the managed instance of this context
    • mergeCompositionOwnerFromChild

      default Object mergeCompositionOwnerFromChild(Object owner)
      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 for DataContext.isModified(Object), so a reopened editor of the owner keeps this context's instance instead of reloading a stale copy. The owner does not enter DataContext.getModified() and is never persisted on its own.

      Parameters:
      owner - the owner instance of the child context
      Returns:
      the managed instance of this context