public class SqlBuilder extends Object implements Expression, Predicate
Expression and
Predicate implementations| Constructor and Description |
|---|
SqlBuilder(org.josql.Query query) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addVariables(Map<String,Object> map) |
void |
assertMatches(String text,
Exchange exchange) |
protected void |
configureQuery(Exchange exchange) |
<T> T |
evaluate(Exchange exchange,
Class<T> type)
Returns the value of the expression on the given exchange
|
protected List<?> |
evaluateQuery(Exchange exchange) |
Map<String,Object> |
getVariables() |
boolean |
matches(Exchange exchange)
Evaluates the predicate on the message exchange and returns true if this
exchange matches the predicate
|
protected boolean |
matches(Exchange exchange,
List<?> list) |
void |
setVariables(Map<String,Object> properties) |
static SqlBuilder |
sql(String sql)
Creates a new builder for the given SQL query string
|
SqlBuilder |
variable(String name,
Object value)
Adds the variable value to be used by the SQL query
|
public <T> T evaluate(Exchange exchange, Class<T> type)
Expressionevaluate in interface Expressionexchange - the message exchange on which to evaluate the expressiontype - the expected type of the evaluation resultpublic boolean matches(Exchange exchange)
Predicatepublic void assertMatches(String text, Exchange exchange) throws AssertionError
AssertionErrorpublic static SqlBuilder sql(String sql) throws org.josql.QueryParseException
sql - the SQL query to performorg.josql.QueryParseException - if there is an issue with the SQLpublic SqlBuilder variable(String name, Object value)
protected void configureQuery(Exchange exchange)
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.