Klasse UiQueryTable<E extends Entity>

Alle implementierten Schnittstellen:
UiHasActionEvents<E,UiQueryTable<E>>, UiHasFocusEvents<E,UiQueryTable<E>>, UiHasUpdateEvents<E,UiQueryTable<E>>, org.obrel.core.Relatable

public class UiQueryTable<E extends Entity> extends UiTableControl<E,UiQueryTable<E>> implements UiHasUpdateEvents<E,UiQueryTable<E>>, UiHasActionEvents<E,UiQueryTable<E>>
A table that displays the result of a database query.
  • Konstruktordetails

  • Methodendetails

    • getCurrentQuery

      public final de.esoco.storage.QueryPredicate<E> getCurrentQuery()
      Returns the current storage query for this parameter, including the filter criteria that have been set by the user.
      Gibt zurück:
      The current query
    • getSelection

      public E getSelection()
      Returns the currently selected entity.
      Gibt zurück:
      The selected entity (NULL for none)
    • onAction

      public UiQueryTable<E> onAction(Consumer<E> eventHandler)
      Registers an event handler that will be invoked on action events with the new component value.
      Angegeben von:
      onAction in Schnittstelle UiHasActionEvents<E extends Entity,UiQueryTable<E extends Entity>>
      Parameter:
      eventHandler - The event handler to be invoked
      Gibt zurück:
      The component the handler has been registered on
    • onSelection

      public final UiQueryTable<E> onSelection(Consumer<E> eventHandler)
      Sets the event handler for selection events of this table.
      Parameter:
      eventHandler - The event handler
      Gibt zurück:
      This instance for concatenation
    • onSelectionConfirmed

      public final UiQueryTable<E> onSelectionConfirmed(Consumer<E> eventHandler)
      Sets the event handler for selection confirmed events (e.g. by double click) of this table.
      Parameter:
      eventHandler - The event handler
      Gibt zurück:
      This instance for concatenation
    • onUpdate

      public UiQueryTable<E> onUpdate(Consumer<E> eventHandler)
      Registers an event handler that will be invoked on update events with the new component value.
      Angegeben von:
      onUpdate in Schnittstelle UiHasUpdateEvents<E extends Entity,UiQueryTable<E extends Entity>>
      Parameter:
      eventHandler - The event handler to be invoked
      Gibt zurück:
      The component the handler has been registered on
    • orderBy

      public UiQueryTable<E> orderBy(org.obrel.core.RelationType<?> orderAttribute, boolean ascending)
      Sets the default query order for a single attribute. For complex order criteria see setOrderBy(Predicate).
      Parameter:
      orderAttribute - The entity attribute to order the query by
      ascending - TRUE for ascending, FALSE for descending ordering
      Gibt zurück:
      This instance for fluent invocation
    • query

      public UiQueryTable<E> query(de.esoco.lib.expression.Predicate<? super E> criteria)
      Sets the storage query criteria of this table.
      Parameter:
      criteria - The query criteria to apply (NULL for none)
      Gibt zurück:
      This instance for fluent invocation
    • setColumns

      @SafeVarargs public final void setColumns(de.esoco.lib.expression.Function<? super E,?>... attributes)
      Sets the attributes to be displayed for entity queries.
      Siehe auch:
    • setColumns

      public void setColumns(Collection<de.esoco.lib.expression.Function<? super E,?>> columnAttributes)
      Sets the entity attributes to be displayed as the table columns. The datatype of a column is a function that queries the attributes from an entity. This applies to standard relation types as these are also functions that can be applied to relatable objects (like entities). But that can also be compound functions that generate the attribute value to displayed in a result table on access. An example could be a function that extracts the name from an entity reference (e.g. NAME.from(OTHER_ENTITY)).
      Parameter:
      columnAttributes - The entity attribute access functions
    • setOrderBy

      public void setOrderBy(de.esoco.lib.expression.Predicate<? super Entity> order)
      Sets the default query order with a predicate that may contain multiple order criteria. For ordering by a single entity attribute see method setOrderBy(RelationType, boolean).
      Parameter:
      order - The sort order criteria (NULL for none)
    • setOrderBy

      public void setOrderBy(org.obrel.core.RelationType<?> orderAttribute, boolean ascending)
      Sets the default query order for a single attribute. For complex order criteria see setOrderBy(Predicate).
      Parameter:
      orderAttribute - The entity attribute to order the query by
      ascending - TRUE for ascending, FALSE for descending ordering
    • setQuery

      public void setQuery(de.esoco.lib.expression.Predicate<? super E> criteria)
      Sets the storage query criteria of this table.
      Parameter:
      criteria - The query criteria to apply (NULL for none)
    • setSelection

      public void setSelection(E value)
      Sets (or clears) the currently selected entity.
      Parameter:
      value - The new selection or NULL for none