Module is.codion.framework.model
Package is.codion.framework.model
Class DefaultForeignKeyDetailModelLink<M extends DefaultEntityModel<M,E,T>,E extends AbstractEntityEditModel,T extends EntityTableModel<E>>
java.lang.Object
is.codion.framework.model.DefaultDetailModelLink<M,E,T>
is.codion.framework.model.DefaultForeignKeyDetailModelLink<M,E,T>
- Type Parameters:
M
- theEntityModel
typeE
- theEntityEditModel
typeT
- theEntityTableModel
type
- All Implemented Interfaces:
DetailModelLink<M,
,E, T> ForeignKeyDetailModelLink<M,
E, T>
- Direct Known Subclasses:
SwingForeignKeyDetailModelLink
public class DefaultForeignKeyDetailModelLink<M extends DefaultEntityModel<M,E,T>,E extends AbstractEntityEditModel,T extends EntityTableModel<E>>
extends DefaultDetailModelLink<M,E,T>
implements ForeignKeyDetailModelLink<M,E,T>
A default
ForeignKeyDetailModelLink
implementation.-
Field Summary
Fields inherited from interface is.codion.framework.model.ForeignKeyDetailModelLink
CLEAR_FOREIGN_KEY_CONDITION_ON_EMPTY_SELECTION, CLEAR_FOREIGN_KEY_VALUE_ON_EMPTY_SELECTION, REFRESH_ON_SELECTION, SET_FOREIGN_KEY_CONDITION_ON_INSERT, SET_FOREIGN_KEY_VALUE_ON_INSERT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal State
Returns theState
controlling whether the detail table model should clear the foreign key search condition when no value is selected in the master modelfinal State
Returns theState
controlling whether the detail model should set the foreign key to null when null or no value is selected in the master model.final ForeignKey
void
onDelete
(Collection<Entity> deletedEntities) Called when delete is performed in the master model, regardless of entity type.void
onInsert
(Collection<Entity> insertedEntities) Called when a insert is performed in the master model, regardless of entity type.void
onSelection
(Collection<Entity> selectedEntities) Called when the selection changes in the master modelvoid
onUpdate
(Map<Entity.Key, Entity> updatedEntities) Called when an update is performed in the master model, regardless of entity type.final State
final State
final State
Methods inherited from class is.codion.framework.model.DefaultDetailModelLink
active, detailModel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface is.codion.framework.model.DetailModelLink
active, detailModel
-
Constructor Details
-
DefaultForeignKeyDetailModelLink
- Parameters:
detailModel
- the detail modelforeignKey
- the foreign key to base this link on
-
-
Method Details
-
foreignKey
- Specified by:
foreignKey
in interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the foreign key representing this detail model
-
setForeignKeyConditionOnInsert
- Specified by:
setForeignKeyConditionOnInsert
in interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the
State
controlling whether the detail table model should automatically search by the inserted entity when an insert is performed in a master model - See Also:
-
setForeignKeyValueOnInsert
- Specified by:
setForeignKeyValueOnInsert
in interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the
State
controlling whether the detail edit model should automatically set the foreign key value to the inserted entity - See Also:
-
refreshOnSelection
- Specified by:
refreshOnSelection
in interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the
State
controlling 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
Description copied from interface:ForeignKeyDetailModelLink
Returns theState
controlling whether the detail model should set the foreign key to null when null or no value is selected in the master model.- Specified by:
clearForeignKeyValueOnEmptySelection
in interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the
State
controlling whether a null selection should result in the foreign key being set to null - See Also:
-
clearForeignKeyConditionOnEmptySelection
Description copied from interface:ForeignKeyDetailModelLink
Returns theState
controlling whether the detail table model should clear the foreign key search condition when no value is selected in the master model- Specified by:
clearForeignKeyConditionOnEmptySelection
in interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the
State
controlling whether an empty selection should result in the foreign key search condition being cleared - See Also:
-
onSelection
Description copied from interface:DetailModelLink
Called when the selection changes in the master model- Specified by:
onSelection
in interfaceDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Parameters:
selectedEntities
- the selected master entities
-
onInsert
Description copied from interface:DetailModelLink
Called when a insert is performed in the master model, regardless of entity type.- Specified by:
onInsert
in interfaceDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Parameters:
insertedEntities
- the inserted entities
-
onUpdate
Description copied from interface:DetailModelLink
Called when an update is performed in the master model, regardless of entity type.- Specified by:
onUpdate
in interfaceDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Parameters:
updatedEntities
- the updated entities, mapped to their original primary keys
-
onDelete
Description copied from interface:DetailModelLink
Called when delete is performed in the master model, regardless of entity type.- Specified by:
onDelete
in interfaceDetailModelLink<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Parameters:
deletedEntities
- the deleted entities
-