public class QueryMapper<T> extends Object
Constructor and Description |
---|
QueryMapper(QueryProcessorIF processor) |
QueryMapper(QueryProcessorIF processor,
DeclarationContextIF context) |
Modifier and Type | Method and Description |
---|---|
protected QueryResultIF |
execute(String query,
Map<String,?> params) |
boolean |
isTrue(String query)
EXPERIMENTAL: Returns true if the query produces a row and
false if the query produces no rows.
|
boolean |
isTrue(String query,
Map<String,?> params)
EXPERIMENTAL: Returns true if the query produces a row and
false if the query produces no rows.
|
List<T> |
queryForList(String query)
EXPERIMENTAL: Runs the query, and returns a the single value in
each row.
|
List<T> |
queryForList(String query,
Map<String,?> params)
EXPERIMENTAL: Runs the query, and returns a the single value in
each row.
|
List<T> |
queryForList(String query,
RowMapperIF<T> mapper)
EXPERIMENTAL: Runs the query, and calls the mapper for each row
in the query result.
|
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.
|
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.
|
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.
|
T |
queryForObject(String query)
EXPERIMENTAL: Returns the value in the first column in the first
row of the query result.
|
T |
queryForObject(String query,
Map<String,?> params)
EXPERIMENTAL: Returns the value in the first column in the first
row of the query result.
|
T |
queryForObject(String query,
RowMapperIF<T> mapper)
EXPERIMENTAL: Returns the value in the first column in the first
row of the query result.
|
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.
|
protected T |
wrapValue(Object value) |
public QueryMapper(QueryProcessorIF processor)
public QueryMapper(QueryProcessorIF processor, DeclarationContextIF context)
public boolean isTrue(String query)
public boolean isTrue(String query, Map<String,?> params)
public T queryForObject(String query)
public T queryForObject(String query, Map<String,?> params)
public T queryForObject(String query, RowMapperIF<T> mapper)
public T queryForObject(String query, RowMapperIF<T> mapper, Map<String,?> params)
public List<T> queryForList(String query)
public List<T> queryForList(String query, RowMapperIF<T> mapper)
public List<T> queryForList(String query, Map<String,?> params)
public List<T> queryForList(String query, RowMapperIF<T> mapper, Map<String,?> params)
public Map<String,T> queryForMap(String query)
public Map<String,T> queryForMap(String query, Map<String,?> params)
protected QueryResultIF execute(String query, Map<String,?> params) throws InvalidQueryException
InvalidQueryException