org.apache.camel.builder.sql
Class SqlBuilder

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

public class SqlBuilder
extends Object
implements org.apache.camel.Expression, org.apache.camel.Predicate

A builder of SQL Expression and Predicate implementations

Version:

Constructor Summary
SqlBuilder(org.josql.Query query)
           
 
Method Summary
protected  void addVariables(Map<String,Object> map)
           
 void assertMatches(String text, org.apache.camel.Exchange exchange)
           
protected  void configureQuery(org.apache.camel.Exchange exchange)
           
<T> T
evaluate(org.apache.camel.Exchange exchange, Class<T> type)
           
protected  List<?> evaluateQuery(org.apache.camel.Exchange exchange)
           
 Map<String,Object> getVariables()
           
 boolean matches(org.apache.camel.Exchange exchange)
           
protected  boolean matches(org.apache.camel.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(org.apache.camel.Exchange exchange,
                      Class<T> type)
Specified by:
evaluate in interface org.apache.camel.Expression

matches

public boolean matches(org.apache.camel.Exchange exchange)
Specified by:
matches in interface org.apache.camel.Predicate

assertMatches

public void assertMatches(String text,
                          org.apache.camel.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(org.apache.camel.Exchange exchange,
                          List<?> list)

evaluateQuery

protected List<?> evaluateQuery(org.apache.camel.Exchange exchange)

configureQuery

protected void configureQuery(org.apache.camel.Exchange exchange)

addVariables

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


Apache Camel