Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditModel<R extends EntityEditor<R>>
- Type Parameters:
R- theEntityEditortype
- All Known Implementing Classes:
AbstractEntityEditModel,SwingEntityEditModel
public interface EntityEditModel<R extends EntityEditor<R>>
Represents the context for editing an
Entity instance.
The underlying attribute values are available via EntityEditor.value(Attribute).- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDo not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.editor()Returns aEntityEditorwrapping the entity being edited.entities()default voidrestore(Preferences preferences) Restores any custom persistent state from the given preferences node.default voidstore(Preferences preferences) Stores any custom persistent state to the given preferences node.
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the type of the entity this edit model is based on
-
connectionProvider
EntityConnectionProvider connectionProvider()- Returns:
- the connection provider used by this edit model
-
connection
EntityConnection connection()Do not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.- Returns:
- the connection used by this edit model
-
editor
R editor()Returns aEntityEditorwrapping the entity being edited.EntityEditor.EditorEntity.get()returns an immutable copy of theEntityinstance being edited, whileEntityEditor.EditorEntity.set(Entity)copies the values from the givenEntityinto the underlyingEntity. Note that value changes must go through theEntityEditor.EditorValueaccessible viaEntityEditor.value(Attribute).- Returns:
- the
EntityEditorwrapping theEntityinstance being edited - See Also:
-
entities
Entities entities()- Returns:
- the underlying domain entities
-
entityDefinition
EntityDefinition entityDefinition()- Returns:
- the definition of the underlying entity
-
store
Stores any custom persistent state to the given preferences node. Does nothing by default, override to persist edit model state along with the rest of the model tree.- Parameters:
preferences- the preferences node to store to- See Also:
-
restore
Restores any custom persistent state from the given preferences node. Does nothing by default, override to restore edit model state along with the rest of the model tree.- Parameters:
preferences- the preferences node to restore from- See Also:
-