Class ResultSetMappingQuery

java.lang.Object
cz.cvut.kbss.jopa.model.QueryImpl
cz.cvut.kbss.jopa.model.ResultSetMappingQuery
All Implemented Interfaces:
Query

public class ResultSetMappingQuery extends QueryImpl
Implementation of query using result set mapping configuration.
  • Constructor Details

  • Method Details

    • executeUpdate

      public void executeUpdate()
      Description copied from interface: Query
      Execute an update or delete statement.
      Specified by:
      executeUpdate in interface Query
    • hasParameter

      public boolean hasParameter(String name)
    • hasParameter

      public boolean hasParameter(int position)
    • getParameter

      public Parameter<?> getParameter(int position)
      Description copied from interface: Query
      Gets the parameter object corresponding to the declared positional parameter with the given position. This method is not required to be supported for native queries.
      Specified by:
      getParameter in interface Query
      Parameters:
      position - position
      Returns:
      parameter object
    • getParameter

      public Parameter<?> getParameter(String name)
      Description copied from interface: Query
      Gets the parameter object corresponding to the declared parameter of the given name. This method is not required to be supported for native queries.
      Specified by:
      getParameter in interface Query
      Parameters:
      name - Parameter name
      Returns:
      parameter object
    • getParameters

      public Set<Parameter<?>> getParameters()
      Description copied from interface: Query
      Gets the parameter objects corresponding to the declared parameters of the query. Returns empty set if the query has no parameters. This method is not required to be supported for native queries.
      Specified by:
      getParameters in interface Query
      Returns:
      set of parameter objects
    • isBound

      public boolean isBound(Parameter<?> parameter)
      Description copied from interface: Query
      Returns a boolean indicating whether a value has been bound to the parameter.
      Specified by:
      isBound in interface Query
      Parameters:
      parameter - parameter object
      Returns:
      boolean indicating whether parameter has been bound
    • getParameterValue

      public Object getParameterValue(String name)
      Description copied from interface: Query
      Returns the input value bound to the named parameter.
      Specified by:
      getParameterValue in interface Query
      Parameters:
      name - parameter name
      Returns:
      parameter value
    • getParameterValue

      public Object getParameterValue(int position)
      Description copied from interface: Query
      Returns the input value bound to the positional parameter.
      Specified by:
      getParameterValue in interface Query
      Parameters:
      position - position
      Returns:
      parameter value
    • getParameterValue

      public <T> T getParameterValue(Parameter<T> parameter)
      Description copied from interface: Query
      Returns the input value bound to the parameter.
      Specified by:
      getParameterValue in interface Query
      Parameters:
      parameter - parameter object
      Returns:
      parameter value
    • setParameter

      public Query setParameter(int position, Object value)
      Description copied from interface: Query
      Binds an argument value to a positional parameter.

      This version exploits the type of the parameter value and maps it to the corresponding XSD datatype (if it exists).

      Specified by:
      setParameter in interface Query
      Parameters:
      position - position
      value - parameter value
      Returns:
      this query instance
      See Also:
    • setParameter

      public Query setParameter(int position, String value, String language)
      Description copied from interface: Query
      Binds a String argument value to a positional parameter.
      Specified by:
      setParameter in interface Query
      Parameters:
      position - position
      value - parameter value
      language - language tag for the parameter value
      Returns:
      this query instance
    • setParameter

      public Query setParameter(String name, Object value)
      Description copied from interface: Query
      Binds an argument value to a named parameter.

      This version exploits the type of the parameter value and maps it to the corresponding XSD datatype (if it exists).

      Specified by:
      setParameter in interface Query
      Parameters:
      name - parameter name
      value - parameter value
      Returns:
      this query instance
      See Also:
    • setParameter

      public Query setParameter(String name, String value, String language)
      Description copied from interface: Query
      Binds a String argument value to a named parameter.
      Specified by:
      setParameter in interface Query
      Parameters:
      name - parameter name
      value - parameter value
      language - language tag for the parameter value
      Returns:
      this query instance
    • setUntypedParameter

      public Query setUntypedParameter(int position, Object value)
      Description copied from interface: Query
      Binds an argument value to a positional parameter.

      This version does not express the type of the value in the query. Instead, it inserts the value directly into the query string. Can be useful e.g. for specifying OFFSET or LIMIT values.

      Specified by:
      setUntypedParameter in interface Query
      Parameters:
      position - position
      value - parameter value
      Returns:
      this query instance
    • setUntypedParameter

      public Query setUntypedParameter(String name, Object value)
      Description copied from interface: Query
      Binds an argument value to a named parameter.

      This version does not express the type of the value in the query. Instead, it inserts the value directly into the query string. Can be useful e.g. for specifying OFFSET or LIMIT values.

      Specified by:
      setUntypedParameter in interface Query
      Parameters:
      name - parameter name
      value - parameter value
      Returns:
      this query instance
    • getMaxResults

      public int getMaxResults()
      Description copied from interface: Query
      The maximum number of results the query object was set to retrieve.

      Returns Integer.MAX_VALUE if Query.setMaxResults(int) was not applied to the query object.

      Specified by:
      getMaxResults in interface Query
      Returns:
      maximum number of results
    • getFirstResult

      public int getFirstResult()
      Description copied from interface: Query
      The position of the first result the query object was set to retrieve.

      Returns 0 if setFirstResult was not applied to the query object.

      Specified by:
      getFirstResult in interface Query
      Returns:
      position of the first result
    • setParameter

      public <T> Query setParameter(Parameter<T> parameter, T value)
      Description copied from interface: Query
      Binds the value of a Parameter object.

      This version exploits the type of the parameter value and maps it to the corresponding XSD datatype (if it exists).

      Specified by:
      setParameter in interface Query
      Parameters:
      parameter - parameter object
      value - parameter value
      Returns:
      this query instance
      See Also:
    • setParameter

      public Query setParameter(Parameter<String> parameter, String value, String language)
      Description copied from interface: Query
      Binds the value of a String Parameter.
      Specified by:
      setParameter in interface Query
      Parameters:
      parameter - parameter object
      value - parameter value
      language - language tag for the parameter value
      Returns:
      this query instance
    • setUntypedParameter

      public <T> Query setUntypedParameter(Parameter<T> parameter, T value)
      Description copied from interface: Query
      Binds the value of a Parameter object.

      This version does not express the type of the value in the query. Instead, it inserts the value directly into the query string. Can be useful e.g. for specifying OFFSET or LIMIT values.

      Specified by:
      setUntypedParameter in interface Query
      Parameters:
      parameter - parameter object
      value - parameter value
      Returns:
      this query instance
    • setHint

      public Query setHint(String hintName, Object value)
      Description copied from interface: Query
      Sets a query hint.

      The hints elements may be used to specify query properties and hints. Vendor-specific hints that are not recognized by a provider are silently ignored.

      Specified by:
      setHint in interface Query
      Parameters:
      hintName - Name of the query hint
      value - Value of the query hint
      Returns:
      this query instance
    • getHints

      public Map<String,Object> getHints()
      Description copied from interface: Query
      Gets the hints and associated values that are in effect for this query instance.
      Specified by:
      getHints in interface Query
      Returns:
      Map of query hints with values