Class AbstractSQLClause<C extends AbstractSQLClause<C>>

java.lang.Object
com.querydsl.sql.dml.AbstractSQLClause<C>
Type Parameters:
C - concrete subtype
All Implemented Interfaces:
DMLClause<C>
Direct Known Subclasses:
AbstractSQLDeleteClause, AbstractSQLInsertClause, AbstractSQLUpdateClause, SetQueryBandClause, SQLMergeClause

public abstract class AbstractSQLClause<C extends AbstractSQLClause<C>> extends Object implements DMLClause<C>
AbstractSQLClause is a superclass for SQL based DMLClause implementations
Author:
tiwe
  • Field Details

  • Constructor Details

  • Method Details

    • addListener

      public void addListener(SQLListener listener)
      Add a listener
      Parameters:
      listener - listener to add
    • clear

      public abstract void clear()
      Clear the internal state of the clause
    • startContext

      protected SQLListenerContextImpl startContext(Connection connection, QueryMetadata metadata, RelationalPath<?> entity)
      Called to create and start a new SQL Listener context
      Parameters:
      connection - the database connection
      metadata - the meta data for that context
      entity - the entity for that context
      Returns:
      the newly started context
    • onException

      protected void onException(SQLListenerContextImpl context, Exception e)
      Called to make the call back to listeners when an exception happens
      Parameters:
      context - the current context in play
      e - the exception
    • endContext

      protected void endContext(SQLListenerContextImpl context)
      Called to end a SQL listener context
      Parameters:
      context - the listener context to end
    • createBindings

      protected SQLBindings createBindings(QueryMetadata metadata, SQLSerializer serializer)
    • createSerializer

      protected SQLSerializer createSerializer()
    • getSQL

      public abstract List<SQLBindings> getSQL()
      Get the SQL string and bindings
      Returns:
      SQL and bindings
    • setParameters

      protected void setParameters(PreparedStatement stmt, List<?> objects, List<Path<?>> constantPaths, Map<ParamExpression<?>,?> params)
      Set the parameters to the given PreparedStatement
      Parameters:
      stmt - preparedStatement to be populated
      objects - list of constants
      constantPaths - list of paths related to the constants
      params - map of param to value for param resolving
    • executeBatch

      protected long executeBatch(Collection<PreparedStatement> stmts) throws SQLException
      Throws:
      SQLException
    • close

      protected void close(Statement stmt)
    • close

      protected void close(Collection<? extends Statement> stmts)
    • close

      protected void close(ResultSet rs)
    • logQuery

      protected void logQuery(Logger logger, String queryString, Collection<Object> parameters)
    • reset

      protected void reset()
    • connection

      protected Connection connection()
    • setUseLiterals

      public void setUseLiterals(boolean useLiterals)
    • getBatchCount

      public abstract int getBatchCount()