Interface EditorLink.BeforeInsert

Enclosing interface:
EditorLink
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface EditorLink.BeforeInsert

Builder input describing how to prepare a detail entity prior to insertion, given the freshly-inserted master entity.

For ForeignKeyEditorLink the framework supplies the canonical implementation (detail, master, connection) -> detail.set(foreignKey, master). For non-FK links the user supplies whatever logic ensures the inserted detail will match the link's EditorLink.DetailCondition on subsequent loads.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(Entity detail, Entity master, EntityConnection connection)
    Invoked on a background thread within the master's transaction, immediately before the detail row is inserted.
  • Method Details

    • apply

      void apply(Entity detail, Entity master, EntityConnection connection)

      Invoked on a background thread within the master's transaction, immediately before the detail row is inserted. The supplied connection is the master's active transactional connection — any I/O performed here participates in the same transaction (so an exception rolls master and detail back together).

      Parameters:
      detail - the detail entity, mutable, about to be inserted
      master - the freshly-inserted master entity
      connection - the master's active transactional connection