Module is.codion.framework.model
Package is.codion.framework.model
Interface ForeignKeyDetailModelLink<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
- Type Parameters:
M- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltype
- All Superinterfaces:
DetailModelLink<M,E, T>
- All Known Implementing Classes:
DefaultForeignKeyDetailModelLink
public interface ForeignKeyDetailModelLink<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
extends DetailModelLink<M,E,T>
Represents a link between a master and detail model based on a foreign key.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether a detail model clears the foreign key search condition when null or no value is selected in a master model
Value type: Boolean
Default value: truestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether a detail model sets the master foreign key value to null when null or no value is selected in a master model
Value type: Boolean
Default value: falsestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether a detail model should be automatically refreshed when the selection in the master model changes.static final is.codion.common.property.PropertyValue<Boolean>Specifies whether a detail model should automatically search by the entity inserted by the master model.static final is.codion.common.property.PropertyValue<Boolean>Specifies whether a detail model should automatically set the foreign key value to the entity inserted by the master model. -
Method Summary
Modifier and TypeMethodDescriptionis.codion.common.state.StateReturns theStatecontrolling whether the detail table model should clear the foreign key search condition when no value is selected in the master modelis.codion.common.state.StateReturns theStatecontrolling whether the detail model should set the foreign key to null when null or no value is selected in the master model.is.codion.framework.domain.entity.attribute.ForeignKeyis.codion.common.state.Stateis.codion.common.state.Stateis.codion.common.state.StateMethods inherited from interface is.codion.framework.model.DetailModelLink
active, detailModel, onDelete, onInsert, onSelection, onUpdate
-
Field Details
-
SET_FOREIGN_KEY_VALUE_ON_INSERT
Specifies whether a detail model should automatically set the foreign key value to the entity inserted by the master model.- Value type: Boolean
- Default value: true
-
SET_FOREIGN_KEY_CONDITION_ON_INSERT
Specifies whether a detail model should automatically search by the entity inserted by the master model.- Value type: Boolean
- Default value: false
-
REFRESH_ON_SELECTION
Specifies whether a detail model should be automatically refreshed when the selection in the master model changes.- Value type: Boolean
- Default value: true
-
CLEAR_FOREIGN_KEY_VALUE_ON_EMPTY_SELECTION
static final is.codion.common.property.PropertyValue<Boolean> CLEAR_FOREIGN_KEY_VALUE_ON_EMPTY_SELECTIONSpecifies whether a detail model sets the master foreign key value to null when null or no value is selected in a master model
- Value type: Boolean
- Default value: false
- Value type: Boolean
-
CLEAR_FOREIGN_KEY_CONDITION_ON_EMPTY_SELECTION
static final is.codion.common.property.PropertyValue<Boolean> CLEAR_FOREIGN_KEY_CONDITION_ON_EMPTY_SELECTIONSpecifies whether a detail model clears the foreign key search condition when null or no value is selected in a master model
- Value type: Boolean
- Default value: true
- Value type: Boolean
-
-
Method Details
-
foreignKey
is.codion.framework.domain.entity.attribute.ForeignKey foreignKey()- Returns:
- the foreign key representing this detail model
-
setForeignKeyConditionOnInsert
is.codion.common.state.State setForeignKeyConditionOnInsert()- Returns:
- the
Statecontrolling whether the detail table model should automatically search by the inserted entity when an insert is performed in a master model - See Also:
-
setForeignKeyValueOnInsert
is.codion.common.state.State setForeignKeyValueOnInsert()- Returns:
- the
Statecontrolling whether the detail edit model should automatically set the foreign key value to the inserted entity - See Also:
-
refreshOnSelection
is.codion.common.state.State refreshOnSelection()- Returns:
- the
Statecontrolling whether the detail table model should be automatically refreshed when the foreign key condition is set according to the master model selection - See Also:
-
clearForeignKeyValueOnEmptySelection
is.codion.common.state.State clearForeignKeyValueOnEmptySelection()Returns theStatecontrolling whether the detail model should set the foreign key to null when null or no value is selected in the master model.- Returns:
- the
Statecontrolling whether a null selection should result in the foreign key being set to null - See Also:
-
clearForeignKeyConditionOnEmptySelection
is.codion.common.state.State clearForeignKeyConditionOnEmptySelection()Returns theStatecontrolling whether the detail table model should clear the foreign key search condition when no value is selected in the master model- Returns:
- the
Statecontrolling whether an empty selection should result in the foreign key search condition being cleared - See Also:
-