org.mule.module.db.internal.domain.query
Class QueryTemplate

java.lang.Object
  extended by org.mule.module.db.internal.domain.query.QueryTemplate

public class QueryTemplate
extends Object

Defines a SQL query that could be executed against a database connection.


Constructor Summary
QueryTemplate(QueryTemplate source)
          Creates a SQL template from another query template
QueryTemplate(String sqlText, QueryType type, List<QueryParam> params)
          Creates a static SQL query template.
QueryTemplate(String sqlText, QueryType type, List<QueryParam> params, boolean dynamic)
          Creates a SQL query template.
 
Method Summary
 List<InputQueryParam> getInputParams()
          Returns the input parameter definitions.
 List<OutputQueryParam> getOutputParams()
          Returns the output parameter definitions.
 List<QueryParam> getParams()
           
 String getSqlText()
          Returns the SQL sentence for this query.
 QueryType getType()
          Returns the type of SQL query.
 boolean isDynamic()
          Indicates whether or not the query is dynamic.
 boolean usesNamedParameters()
          Indicates whether or not the query uses named parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryTemplate

public QueryTemplate(String sqlText,
                     QueryType type,
                     List<QueryParam> params)
Creates a static SQL query template.

Parameters:
sqlText - sql text containing placeholders for each input and output parameter.
type - the type of SQL query.
params - parameters definitions for the query. Non null

QueryTemplate

public QueryTemplate(String sqlText,
                     QueryType type,
                     List<QueryParam> params,
                     boolean dynamic)
Creates a SQL query template.

Parameters:
sqlText - sql text containing placeholders for each input and output parameter.
type - the type of SQL query.
params - parameters definitions for the query. Non null
dynamic - indicates whether or not the query is dynamic

QueryTemplate

public QueryTemplate(QueryTemplate source)
Creates a SQL template from another query template

Parameters:
source - query template to clone
Method Detail

getSqlText

public String getSqlText()
Returns the SQL sentence for this query.


getInputParams

public List<InputQueryParam> getInputParams()
Returns the input parameter definitions. Input/output parameters should be also included.


getOutputParams

public List<OutputQueryParam> getOutputParams()
Returns the output parameter definitions. Input/output parameters should be also included.


getParams

public List<QueryParam> getParams()

getType

public QueryType getType()
Returns the type of SQL query.


isDynamic

public boolean isDynamic()
Indicates whether or not the query is dynamic.

A query is dynamic when the effective SQL text that will be used to execute it will be resolved on runtime depending on external information.


usesNamedParameters

public boolean usesNamedParameters()
Indicates whether or not the query uses named parameters.

Returns:
true if the query uses named parameters, false if there are inline or no parameters


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.