com.j256.ormlite.stmt
Class DeleteBuilder<T,ID>

java.lang.Object
  extended by com.j256.ormlite.stmt.StatementBuilder<T,ID>
      extended by com.j256.ormlite.stmt.DeleteBuilder<T,ID>
Type Parameters:
T - The class that the code will be operating on.
ID - The class of the ID column associated with the class. The T class does not require an ID field. The class needs an ID parameter however so you can use Void or Object to satisfy the compiler.

public class DeleteBuilder<T,ID>
extends StatementBuilder<T,ID>

Assists in building sql DELETE statements for a particular table in a particular database.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.ormlite.stmt.StatementBuilder
StatementBuilder.StatementInfo, StatementBuilder.StatementType
 
Field Summary
 
Fields inherited from class com.j256.ormlite.stmt.StatementBuilder
addTableName, dao, databaseType, tableInfo, tableName, type, where
 
Constructor Summary
DeleteBuilder(DatabaseType databaseType, TableInfo<T,ID> tableInfo, Dao<T,ID> dao)
           
 
Method Summary
protected  void appendStatementEnd(StringBuilder sb, List<ArgumentHolder> argList)
          Append the end of our statement string to the StringBuilder.
protected  void appendStatementStart(StringBuilder sb, List<ArgumentHolder> argList)
          Append the start of our statement string to the StringBuilder.
 void clear()
          Clear out all of the statement settings so we can reuse the builder.
 int delete()
          A short cut to Dao.delete(PreparedDelete).
 PreparedDelete<T> prepare()
          Build and return a prepared delete that can be used by Dao.delete(PreparedDelete) method.
 
Methods inherited from class com.j256.ormlite.stmt.StatementBuilder
appendStatementString, appendWhereStatement, buildStatementString, getResultFieldTypes, prepareStatement, prepareStatementInfo, prepareStatementString, setWhere, shouldPrependTableNameToColumns, verifyColumnName, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteBuilder

public DeleteBuilder(DatabaseType databaseType,
                     TableInfo<T,ID> tableInfo,
                     Dao<T,ID> dao)
Method Detail

prepare

public PreparedDelete<T> prepare()
                          throws SQLException
Build and return a prepared delete that can be used by Dao.delete(PreparedDelete) method. If you change the where or make other calls you will need to re-call this method to re-prepare the statement for execution.

Throws:
SQLException

delete

public int delete()
           throws SQLException
A short cut to Dao.delete(PreparedDelete).

Throws:
SQLException

clear

public void clear()
Description copied from class: StatementBuilder
Clear out all of the statement settings so we can reuse the builder.

Overrides:
clear in class StatementBuilder<T,ID>

appendStatementStart

protected void appendStatementStart(StringBuilder sb,
                                    List<ArgumentHolder> argList)
Description copied from class: StatementBuilder
Append the start of our statement string to the StringBuilder.

Specified by:
appendStatementStart in class StatementBuilder<T,ID>

appendStatementEnd

protected void appendStatementEnd(StringBuilder sb,
                                  List<ArgumentHolder> argList)
Description copied from class: StatementBuilder
Append the end of our statement string to the StringBuilder.

Specified by:
appendStatementEnd in class StatementBuilder<T,ID>


This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.