Interface Select

All Superinterfaces:
Cloneable, Serializable

public interface Select extends Cloneable, Serializable
Model representing a Select statement to query entites from an or session. A Select is related to one entityType and can be created via Session.createSelect(entityTypeName) with the name of the entity type.
Since:
4.0.17
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(@NotNull Order order)
    Appends the given order criteria to the list of defined orders of this select.
    void
    add(@NotNull Parameter parameter)
    Adds the given parameter to this select.
    applyLanguage(@NotNull String languageAbbreviation)
    Make a clone of this select and replace all place holders %lang% contained in constaints with the given languageAbbreviation
    void
    Clears the defined order criterias of this select.
    boolean
    containsParameter(@NotNull String identifier)
    Indicates whether a parameter specified by the given identifier exists or not.
    @Nullable Constraint
    Return the constraint defined by this select.
    Return the name of the entity type which entities in the result set belong to.
    List<de.espirit.or.query.FetchMode>
    Returns all fetch modes defined by this select.
    int
    Return the fetch size which will applied to the JDBC ResultSet to retrieve data from the database.
    int
    The maximum number of entities this select will return.
    @NotNull List<Order>
    Returns an unmodifiable list of defined orders of this select.
    getParameter(@NotNull String identifier)
    Return the parameter with the given identifier.
    Return all parameters defined by this select.
    getParameterValue(@NotNull String identifier)
    Returns the value of the parameter specified by given identifier or null if no parameter exists with the given identifier.
    Returns the xml representation of this select model.
    boolean
    Return true if this select is constructed from a 3.1 query document.
    boolean
    isOrdered(@NotNull String attributeName)
    Return true if an order of the attribute attributeName is already defined in this select.
    void
    Set the select constraint to constraint.
    void
    setDeprecated(boolean flag)
    Set this select to deprecated or not.
    void
    setFetchSize(int size)
    Sets the fetch size for this select which will be applied to the result EntityList returned by executeQuery(Select).
    void
    setMaxResultCount(int maxResultCount)
    Set the maximum number of entities this select will return.
    void
    setParameter(@NotNull String identifier, Object value)
    Sets the value for the parameter specified by the given identifier.
  • Method Details

    • isDeprecated

      boolean isDeprecated()
      Return true if this select is constructed from a 3.1 query document.
      Since:
      4.0.17
    • setDeprecated

      void setDeprecated(boolean flag)
      Set this select to deprecated or not. A deprcated select is the one was constructed from a 3.1 query.
      Since:
      4.0.17
    • getEntityTypeName

      String getEntityTypeName()
      Return the name of the entity type which entities in the result set belong to. Each select produces results from one entity type (table) even more than one entity types can be involved in the constraint of the select.
      Since:
      4.0.17
    • setConstraint

      void setConstraint(Constraint constraint) throws ORException
      Set the select constraint to constraint.
      Throws:
      ORException
      Since:
      4.0.17
    • getConstraint

      @Nullable @Nullable Constraint getConstraint()
      Return the constraint defined by this select.
      Since:
      4.0.17
    • getParameter

      Parameter getParameter(@NotNull @NotNull String identifier) throws ORException
      Return the parameter with the given identifier.
      Throws:
      ORException
      Since:
      4.0.17
    • getParameters

      Collection<Parameter> getParameters()
      Return all parameters defined by this select.
      Since:
      4.0.17
      See Also:
    • add

      void add(@NotNull @NotNull Parameter parameter)
      Adds the given parameter to this select.
      Since:
      4.0.17
      See Also:
    • getFetchModes

      List<de.espirit.or.query.FetchMode> getFetchModes()
      Returns all fetch modes defined by this select.
      Since:
      4.0.17
    • getParameterValue

      Object getParameterValue(@NotNull @NotNull String identifier)
      Returns the value of the parameter specified by given identifier or null if no parameter exists with the given identifier.
      Since:
      4.0.17
      See Also:
    • setParameter

      void setParameter(@NotNull @NotNull String identifier, Object value) throws ORException
      Sets the value for the parameter specified by the given identifier. The given value must match the value class of the parameter. The parameter needs to be registered with add(Parameter) first.
      Throws:
      IllegalArgumentException - if no parameter exists with the given identifier
      ORException
      Since:
      4.0.17
      See Also:
    • getOrders

      @NotNull @NotNull List<Order> getOrders()
      Returns an unmodifiable list of defined orders of this select. The sequence of the list defines the priority of the ordering.
      Since:
      4.0.17
      See Also:
    • isOrdered

      boolean isOrdered(@NotNull @NotNull String attributeName)
      Return true if an order of the attribute attributeName is already defined in this select.
      Since:
      4.0.30
    • add

      void add(@NotNull @NotNull Order order)
      Appends the given order criteria to the list of defined orders of this select.
      Since:
      4.0.17
      See Also:
    • setFetchSize

      void setFetchSize(int size)
      Sets the fetch size for this select which will be applied to the result EntityList returned by executeQuery(Select). The given fetchsize defines the block size of the EntityList which is a lazy list and queries its data in blocks of a specific size. The given fetch size defines the block size of the entity list. If fetch size is not specified the default block size (40 items) will be used for the query result, which is suited for the most use cases.
      Since:
      4.0.17
      See Also:
    • getFetchSize

      int getFetchSize()
      Return the fetch size which will applied to the JDBC ResultSet to retrieve data from the database.
      Since:
      4.0.17
      See Also:
    • getXML

      String getXML()
      Returns the xml representation of this select model.
      Since:
      4.0.17
    • clearOrdering

      void clearOrdering()
      Clears the defined order criterias of this select.
      Since:
      4.0.17
      See Also:
    • containsParameter

      boolean containsParameter(@NotNull @NotNull String identifier)
      Indicates whether a parameter specified by the given identifier exists or not.
      Returns:
      true if a parameter specified by the given identifier exists, false otherwise
      Since:
      4.0.17
    • getMaxResultCount

      int getMaxResultCount()
      The maximum number of entities this select will return. A value of 0 means no restriction (default).
      Since:
      4.0.19
      See Also:
    • setMaxResultCount

      void setMaxResultCount(int maxResultCount)
      Set the maximum number of entities this select will return. A value of 0 means no restriction (default).
      Since:
      4.0.19
      See Also:
    • applyLanguage

      Select applyLanguage(@NotNull @NotNull String languageAbbreviation)
      Make a clone of this select and replace all place holders %lang% contained in constaints with the given languageAbbreviation
      Returns:
      the clone of this select for the language languageAbbreviation
      Since:
      4.0.26