Module is.codion.framework.model
Package is.codion.framework.model
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.
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 TypeMethodDescriptionvoidapply(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
Invoked on a background thread within the master's transaction, immediately before the detail row is inserted. The supplied
connectionis 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 insertedmaster- the freshly-inserted master entityconnection- the master's active transactional connection
-