org.apache.metamodel.jdbc
Class JdbcUtils

java.lang.Object
  extended by org.apache.metamodel.jdbc.JdbcUtils

public final class JdbcUtils
extends Object


Constructor Summary
JdbcUtils()
           
 
Method Summary
static String createWhereClause(List<FilterItem> whereItems, IQueryRewriter queryRewriter, boolean inlineValues)
           
static String[] getTableTypesAsStrings(TableType[] tableTypes)
           
static String getValueAsSql(Column column, Object value, IQueryRewriter queryRewriter)
           
static boolean isPreparedParameterCandidate(FilterItem whereItem)
          Determines if a particular FilterItem will have it's parameter (operand) replaced during SQL generation.
static void setStatementValue(PreparedStatement st, int valueIndex, Column column, Object value)
          Method which handles the action of setting a parameterized value on a statement.
static MetaModelException wrapException(SQLException e, String actionDescription)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcUtils

public JdbcUtils()
Method Detail

wrapException

public static MetaModelException wrapException(SQLException e,
                                               String actionDescription)
                                        throws MetaModelException
Throws:
MetaModelException

setStatementValue

public static void setStatementValue(PreparedStatement st,
                                     int valueIndex,
                                     Column column,
                                     Object value)
                              throws SQLException
Method which handles the action of setting a parameterized value on a statement. Traditionally this is done using the PreparedStatement.setObject(int, Object) method but for some types we use more specific setter methods.

Parameters:
st -
valueIndex -
column -
value -
Throws:
SQLException

getValueAsSql

public static String getValueAsSql(Column column,
                                   Object value,
                                   IQueryRewriter queryRewriter)

createWhereClause

public static String createWhereClause(List<FilterItem> whereItems,
                                       IQueryRewriter queryRewriter,
                                       boolean inlineValues)

isPreparedParameterCandidate

public static boolean isPreparedParameterCandidate(FilterItem whereItem)
Determines if a particular FilterItem will have it's parameter (operand) replaced during SQL generation. Such filter items should succesively have their parameters set at execution time.

Parameters:
whereItem -
Returns:

getTableTypesAsStrings

public static String[] getTableTypesAsStrings(TableType[] tableTypes)


Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.