Interface EntityTableModel<E extends EntityEditModel<R>,R extends EntityEditor<R>>

Type Parameters:
E - the EntityEditModel type
R - the EntityEditor type
All Superinterfaces:
FilterModel<Entity>, FilterTableModel<Entity,Attribute<?>>
All Known Implementing Classes:
AbstractEntityTableModel, SwingEntityTableModel

public interface EntityTableModel<E extends EntityEditModel<R>,R extends EntityEditor<R>> extends FilterTableModel<Entity,Attribute<?>>
Specifies a table model containing Entity instances.
  • Field Details

  • Method Details

    • entityType

      EntityType entityType()
      Returns:
      the type of the entity this table model is based on
    • connection

      EntityConnection connection()

      Typically the single self-managing connection shared by all models of an application, safe to hold on to and use for its lifetime, see EntityApplicationModel.connection().

      Returns:
      the connection used by this table model
    • entities

      Entities entities()
      Returns:
      the underlying domain entities
    • entityDefinition

      EntityDefinition entityDefinition()
      Returns:
      the definition of the underlying entity
    • editModel

      E editModel()
      Returns the EntityEditModel associated with this table model
      Returns:
      the edit model associated with this table model
    • editor

      R editor()
      Returns the EntityEditor associated with this table model
      Returns:
      the editor associated with this table model
    • replace

      void replace(Collection<Entity> entities)
      Replaces the given entities in this table model
      Parameters:
      entities - the entities to replace
    • refresh

      void refresh(Collection<Entity.Key> keys)
      Refreshes the entities with the given keys by re-selecting them from the underlying database.
      Parameters:
      keys - the keys of the entities to refresh
    • onInsert

      Returns:
      the Value controlling the action to perform when entities are inserted via the associated edit model
      See Also:
    • removeDeleted

      State removeDeleted()
      Returns:
      the State controlling whether entities that are deleted via the associated edit model should be automatically removed from this table model
    • select

      void select(Collection<Entity.Key> keys)
      Selects entities according to the primary keys in primaryKeys
      Parameters:
      keys - the primary keys of the entities to select
    • orderQuery

      State orderQuery()
      Specifies whether the current FilterTableModel.sort() order is used as a basis for the EntityQueryModel order by clause. Note that this only applies to column attributes.
      Returns:
      the State controlling whether the current sort order should be used as a basis for the query order by clause
    • query

      Returns:
      the underlying query model
    • store

      void store(Preferences preferences)
      Stores the model-owned persistent state of this table model - the query condition settings, filter settings and sort order - to the given preferences node. May be overridden to persist custom state, in which case super.store(preferences) should be called in order to retain the default state.

      The keys conditions, filters and sort are stored in the given node, along with the edit child node of the edit model, so custom state needs other names.

      Parameters:
      preferences - the preferences node to store to
      See Also:
    • restore

      void restore(Preferences preferences)
      Restores the model-owned persistent state of this table model - the query condition settings, filter settings and sort order - from the given preferences node.
      Parameters:
      preferences - the preferences node to restore from
      See Also:
    • rowEditor

      Returns:
      the EntityTableModel.EntityRowEditor