Class QueryMapper<T>

java.lang.Object
ontopoly.model.QueryMapper<T>

public class QueryMapper<T> extends Object
  • Constructor Details

  • Method Details

    • isTrue

      public boolean isTrue(String query)
      EXPERIMENTAL: Returns true if the query produces a row and false if the query produces no rows.
    • isTrue

      public boolean isTrue(String query, Map<String,?> params)
      EXPERIMENTAL: Returns true if the query produces a row and false if the query produces no rows.
    • queryForObject

      public T queryForObject(String query)
      EXPERIMENTAL: Returns the value in the first column in the first row of the query result. If the query produces no results null is returned.
    • queryForObject

      public T queryForObject(String query, Map<String,?> params)
      EXPERIMENTAL: Returns the value in the first column in the first row of the query result. If the query produces no results null is returned.
    • queryForObject

      public T queryForObject(String query, RowMapperIF<T> mapper)
      EXPERIMENTAL: Returns the value in the first column in the first row of the query result. If the query produces no results null is returned.
    • queryForObject

      public T queryForObject(String query, RowMapperIF<T> mapper, Map<String,?> params)
      EXPERIMENTAL: Returns the mapping of the value in the first column in the first row of the query result. If the query produces no results null is returned.
    • queryForList

      public List<T> queryForList(String query)
      EXPERIMENTAL: Runs the query, and returns a the single value in each row.
    • queryForList

      public List<T> queryForList(String query, RowMapperIF<T> mapper)
      EXPERIMENTAL: Runs the query, and calls the mapper for each row in the query result. Returns a list of all the objects produced by the mapper in query result order.
    • queryForList

      public List<T> queryForList(String query, Map<String,?> params)
      EXPERIMENTAL: Runs the query, and returns a the single value in each row.
    • queryForList

      public List<T> queryForList(String query, RowMapperIF<T> mapper, Map<String,?> params)
      EXPERIMENTAL: Runs the query with the given parameters, and calls the mapper for each row in the query result. Returns a list of all the objects produced by the mapper in query result order.
    • queryForMap

      public Map<String,T> queryForMap(String query)
      EXPERIMENTAL: Returns a map of the first row of the query results, with each variable name (without $) as a key and each variable value as the value of the key. If the query produces no rows the method returns null; if it produces more than one an exception is thrown.
    • queryForMap

      public Map<String,T> queryForMap(String query, Map<String,?> params)
      EXPERIMENTAL: Returns a map of the first row of the query results, with each variable name (without $) as a key and each variable value as the value of the key. If the query produces no rows the method returns null.
    • wrapValue

      protected T wrapValue(Object value)
    • execute

      protected QueryResultIF execute(String query, Map<String,?> params) throws InvalidQueryException
      Throws:
      InvalidQueryException