org.apache.camel.builder.sql
Class SqlBuilder<E extends Exchange>

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

public class SqlBuilder<E extends Exchange>
extends Object
implements Expression<E>, Predicate<E>

A builder of SQL Expression and Predicate implementations

Version:
$Revision: 630591 $

Constructor Summary
SqlBuilder(org.josql.Query query)
           
 
Method Summary
protected  void addVariables(Map<String,Object> map)
           
 void assertMatches(String text, E exchange)
           
protected  void configureQuery(E exchange)
           
 Object evaluate(E exchange)
           
protected  List evaluateQuery(E exchange)
           
 Map<String,Object> getVariables()
           
 boolean matches(E exchange)
           
protected  boolean matches(E exchange, List list)
           
 void setVariables(Map<String,Object> properties)
           
static
<E extends Exchange>
SqlBuilder<E>
sql(String sql)
          Creates a new builder for the given SQL query string
 SqlBuilder<E> 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 Object evaluate(E exchange)
Specified by:
evaluate in interface Expression<E extends Exchange>

matches

public boolean matches(E exchange)
Specified by:
matches in interface Predicate<E extends Exchange>

assertMatches

public void assertMatches(String text,
                          E exchange)
                   throws AssertionError
Specified by:
assertMatches in interface Predicate<E extends Exchange>
Throws:
AssertionError

sql

public static <E extends Exchange> SqlBuilder<E> 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<E> 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(E exchange,
                          List list)

evaluateQuery

protected List evaluateQuery(E exchange)

configureQuery

protected void configureQuery(E exchange)

addVariables

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


Apache CAMEL