Module is.codion.framework.model
Package is.codion.framework.model
Class DefaultEntityEditModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<M,E,T,R>,T extends EntityTableModel<M,E,T,R>,R extends EntityEditor>
java.lang.Object
is.codion.framework.model.DefaultEntityEditModel<M,E,T,R>
- Type Parameters:
M- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltypeR- theEntityEditortype
- All Implemented Interfaces:
EntityEditModel<M,E, T, R>
- Direct Known Subclasses:
SwingEntityEditModel
public class DefaultEntityEditModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<M,E,T,R>,T extends EntityTableModel<M,E,T,R>,R extends EntityEditor>
extends Object
implements EntityEditModel<M,E,T,R>
A default
EntityEditModel implementation-
Constructor Summary
ConstructorsConstructorDescriptionDefaultEntityEditModel(R editor) Instantiates a newDefaultEntityEditModelbased on the given editor -
Method Summary
Modifier and TypeMethodDescriptionfinal EntityConnectionDo not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.final EntityConnectionProviderfinal Reditor()Returns aEntityEditorwrapping the entity being edited.final Entitiesentities()final EntityDefinitionfinal EntityTypefinal StringtoString()
-
Constructor Details
-
DefaultEntityEditModel
Instantiates a newDefaultEntityEditModelbased on the given editor- Parameters:
editor- the editor
-
-
Method Details
-
entities
- Specified by:
entitiesin interfaceEntityEditModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor> - Returns:
- the underlying domain entities
-
entityDefinition
- Specified by:
entityDefinitionin interfaceEntityEditModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor> - Returns:
- the definition of the underlying entity
-
toString
-
entityType
- Specified by:
entityTypein interfaceEntityEditModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor> - Returns:
- the type of the entity this edit model is based on
-
connectionProvider
- Specified by:
connectionProviderin interfaceEntityEditModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor> - Returns:
- the connection provider used by this edit model
-
connection
Description copied from interface:EntityEditModelDo not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.- Specified by:
connectionin interfaceEntityEditModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor> - Returns:
- the connection used by this edit model
-
editor
Description copied from interface:EntityEditModelReturns 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).- Specified by:
editorin interfaceEntityEditModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor> - Returns:
- the
EntityEditorwrapping theEntityinstance being edited - See Also:
-