Klasse QueryResultElement<T>

java.lang.Object
de.esoco.lib.property.AbstractStringProperties
de.esoco.lib.property.StringProperties
de.esoco.data.element.DataElement<List<T>>
de.esoco.data.element.ListDataElement<T>
de.esoco.data.element.QueryResultElement<T>
Alle implementierten Schnittstellen:
de.esoco.lib.model.DataModel<T>, de.esoco.lib.property.HasProperties, de.esoco.lib.property.MutableProperties, Serializable, Iterable<T>

public class QueryResultElement<T> extends ListDataElement<T>
A data element that contains the result of the execution of a storage query. The resulting query rows are encoded in a list of strings which are in turn contained in a list of all rows for a certain query result. The easiest way to process the result rows is by iterating over the result because it implements the Iterable interface. Besides the query rows this class also allows to query the full size of the executed query by invoking the method getQuerySize().

Query results are always readonly.

Siehe auch:
  • Konstruktordetails

    • QueryResultElement

      public QueryResultElement(String name, List<T> rows, int querySize)
      Creates a new instance for a certain query result.
      Parameter:
      name - The element name
      rows - A list containing lists of strings that contains the the query rows
      querySize - The full size of the query represented by this result
  • Methodendetails

    • copy

      public QueryResultElement<T> copy(DataElement.CopyMode mode, de.esoco.lib.property.PropertyName<?>... copyProperties)
      Returns a copy of this data element that contains all or a subset of it's current state. Always copied are the name and flags. Never copied is the parent reference because upon copying typically a reference to a copied parent needs to be set. The further data the copy contains depends on the copy mode:

      The copy instance is created by invoking DataElement.newInstance() which has the recommendation to overwrite the return type to the concrete subtype to prevent the need for casting by the invoking code. For the same reason it is recommended that subclasses also override this method with the concrete return type and cast the result of super.copy() to that type.

      Setzt außer Kraft:
      copy in Klasse DataElement<List<T>>
      Parameter:
      mode - The copy mode
      copyProperties - An optional list of properties to copy. If not provided all properties will be copied (unless the mode is DataElement.CopyMode.PLACEHOLDER)
      Gibt zurück:
      The copied instance
    • getQuerySize

      public final int getQuerySize()
      Returns the full query size for the query represented by this result.
      Gibt zurück:
      The full query size
    • getList

      protected List<T> getList()
      Returns the list.
      Angegeben von:
      getList in Klasse ListDataElement<T>
      Gibt zurück:
      The list
    • newInstance

      protected QueryResultElement<T> newInstance()
      Returns a new instance of the respective data element sub-type on which it is invoked. This is needed for GWT which doesn't support reflection. Used by DataElement.copy(CopyMode, PropertyName...) for cloning an instance. Implementations should overwrite the return type with their concrete type to prevent the need for casting by the invoking code.
      Angegeben von:
      newInstance in Klasse DataElement<List<T>>
      Gibt zurück:
      The new instance
    • updateValue

      protected void updateValue(List<T> newRows)
      Updates the element value. Will be invoked by DataElement.setValue(Object) to store a new value after validation. If a subclass wants to reject certain values it should do so in the DataElement.isValidValue(Validator, Object) method. Subclasses that are always immutable should implement an assertion because if the element has been initialized correctly (validator = NULL) this method should then be reached.
      Angegeben von:
      updateValue in Klasse DataElement<List<T>>
      Parameter:
      newRows - The new value for this element