org.opencms.db
Class CmsStatementBuilder

java.lang.Object
  extended by org.opencms.db.CmsStatementBuilder

public class CmsStatementBuilder
extends Object

A helper class used to accumulate SQL fragments together with the corresponding query parameters.

Since:
8.0.0

Constructor Summary
CmsStatementBuilder()
           
 
Method Summary
 void add(String fragment, List<Object> params)
          Adds an SQL fragment and zero or more query parameters.
 void add(String fragment, Object... params)
          Adds an SQL fragment and zero or more query parameters.
 List<Object> getParameters()
          Returns the list of accumulated query parameters.
 String getQuery()
          Returns the accumulated query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsStatementBuilder

public CmsStatementBuilder()
Method Detail

add

public void add(String fragment,
                List<Object> params)
Adds an SQL fragment and zero or more query parameters.

Parameters:
fragment - the SQL fragment
params - the query parameters

add

public void add(String fragment,
                Object... params)
Adds an SQL fragment and zero or more query parameters.

Parameters:
fragment - the SQL fragment
params - the query parameters

getParameters

public List<Object> getParameters()
Returns the list of accumulated query parameters.

Returns:
the list of accumulated query parameters

getQuery

public String getQuery()
Returns the accumulated query string.

Returns:
the accumulated query string