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- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltype
- All Implemented Interfaces:
DetailModelLink<M,,E, T> ForeignKeyDetailModelLink<M,E, T>
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_ON_EMPTY_SELECTION, REFRESH_ON_SELECTION, SEARCH_BY_INSERTED_ENTITY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultForeignKeyDetailModelLink(M detailModel, is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) -
Method Summary
Modifier and TypeMethodDescriptionfinal is.codion.common.state.StateReturns the State controlling whether the detail model should set the foreign key to null when null or no value is selected in the master model.final is.codion.framework.domain.entity.attribute.ForeignKeyvoidonDelete(Collection<is.codion.framework.domain.entity.Entity> deletedEntities) Called when delete is performed in the master model, regardless of entity type.voidonInsert(Collection<is.codion.framework.domain.entity.Entity> insertedEntities) Called when a insert is performed in the master model, regardless of entity type.voidonSelection(Collection<is.codion.framework.domain.entity.Entity> selectedEntities) Called when the selection changes in the master modelvoidonUpdate(Map<is.codion.framework.domain.entity.Entity.Key, is.codion.framework.domain.entity.Entity> updatedEntities) Called when an update is performed in the master model, regardless of entity type.final is.codion.common.state.Statefinal is.codion.common.state.StateMethods inherited from class is.codion.framework.model.DefaultDetailModelLink
active, detailModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.framework.model.DetailModelLink
active, detailModel
-
Constructor Details
-
DefaultForeignKeyDetailModelLink
public DefaultForeignKeyDetailModelLink(M detailModel, is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) - Parameters:
detailModel- the detail modelforeignKey- the foreign key to base this link on
-
-
Method Details
-
foreignKey
public final is.codion.framework.domain.entity.attribute.ForeignKey foreignKey()- Specified by:
foreignKeyin interfaceForeignKeyDetailModelLink<M extends DefaultEntityModel<M,E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the foreign key representing this detail model
-
searchByInsertedEntity
public final is.codion.common.state.State searchByInsertedEntity()- Specified by:
searchByInsertedEntityin 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:
-
refreshOnSelection
public final is.codion.common.state.State refreshOnSelection()- Specified by:
refreshOnSelectionin 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:
-
clearForeignKeyOnEmptySelection
public final is.codion.common.state.State clearForeignKeyOnEmptySelection()Description copied from interface:ForeignKeyDetailModelLinkReturns the State 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:
clearForeignKeyOnEmptySelectionin 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:
-
onSelection
Description copied from interface:DetailModelLinkCalled when the selection changes in the master model- Specified by:
onSelectionin 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:DetailModelLinkCalled when a insert is performed in the master model, regardless of entity type.- Specified by:
onInsertin interfaceDetailModelLink<M extends DefaultEntityModel<M,E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Parameters:
insertedEntities- the inserted entities
-
onUpdate
public void onUpdate(Map<is.codion.framework.domain.entity.Entity.Key, is.codion.framework.domain.entity.Entity> updatedEntities) Description copied from interface:DetailModelLinkCalled when an update is performed in the master model, regardless of entity type.- Specified by:
onUpdatein 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:DetailModelLinkCalled when delete is performed in the master model, regardless of entity type.- Specified by:
onDeletein interfaceDetailModelLink<M extends DefaultEntityModel<M,E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Parameters:
deletedEntities- the deleted entities
-