org.apache.camel.builder.sql
Class SqlBuilder

java.lang.Object
  extended by org.apache.camel.builder.sql.SqlBuilder
All Implemented Interfaces:
Expression, Predicate

public class SqlBuilder
extends Object
implements Expression, Predicate

A builder of SQL Expression and Predicate implementations

Version:
$Revision: 19209 $

Constructor Summary
SqlBuilder(org.josql.Query query)
           
 
Method Summary
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlBuilder

public SqlBuilder(org.josql.Query query)
Method Detail

evaluate

public <T> T evaluate(Exchange exchange,
                      Class<T> type)
Description copied from interface: Expression
Returns the value of the expression on the given exchange

Specified by:
evaluate in interface Expression
Parameters:
exchange - the message exchange on which to evaluate the expression
type - the expected type of the evaluation result
Returns:
the value of the expression

matches

public boolean matches(Exchange exchange)
Description copied from interface: Predicate
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate

Specified by:
matches in interface Predicate
Parameters:
exchange - the message exchange
Returns:
true if the predicate matches

assertMatches

public void assertMatches(String text,
                          Exchange exchange)
                   throws AssertionError
Throws:
AssertionError

sql

public static SqlBuilder sql(String sql)
                      throws org.josql.QueryParseException
Creates a new builder for the given SQL query string

Parameters:
sql - the SQL query to perform
Returns:
a new builder
Throws:
org.josql.QueryParseException - if there is an issue with the SQL

variable

public SqlBuilder variable(String name,
                           Object value)
Adds the variable value to be used by the SQL query


getVariables

public Map<String,Object> getVariables()

setVariables

public void setVariables(Map<String,Object> properties)

matches

protected boolean matches(Exchange exchange,
                          List list)

evaluateQuery

protected List evaluateQuery(Exchange exchange)

configureQuery

protected void configureQuery(Exchange exchange)

addVariables

protected void addVariables(Map<String,Object> map)


Apache CAMEL