public class DeletionBuilder extends QueryBuilder<DeletionBuilder,java.lang.Integer>
DELETE
query.
int nDeleted = QueryBuilder.deleteFrom( sTableName ) .deleteAll() .executeOn( db ) ;Delete select records from a table:
int nDeleted = QueryBuilder.deleteFrom( sTableName ) .where( "active=? OR last_active_ts<=?", QueryBuilder.WHERE_FALSE, TimeUtils.now() - 86400 ) .executeOn( db ) ;
SQLiteDatabase.delete(String, String, String[])
QueryBuilder.UnboundException
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
LOG_TAG |
m_asExplicitWhereParams, m_dbTarget, m_sExplicitWhereFormat, m_sTableName, m_valsToWrite
Constructor and Description |
---|
DeletionBuilder(java.lang.String sTableName) |
Modifier and Type | Method and Description |
---|---|
DeletionBuilder |
deleteAll()
Convenience grammar specifying that all rows should be deleted.
|
java.lang.Integer |
executeOn(android.database.sqlite.SQLiteDatabase db)
Deletes rows based on the builder's
WHERE clause. |
java.lang.String |
toString()
Constructs a raw SQL
DELETE query based on the attributes of the
builder instance |
deleteFrom, deleteFrom, execute, getWhereClause, getWhereFormat, getWhereParams, insertInto, insertInto, onDatabase, selectFrom, selectFrom, setTableName, setValues, toSQLInputParams, update, update, where, where, where
public DeletionBuilder deleteAll()
public java.lang.Integer executeOn(android.database.sqlite.SQLiteDatabase db)
WHERE
clause.executeOn
in class QueryBuilder<DeletionBuilder,java.lang.Integer>
db
- the database instance on which the query should be executed.SQLiteSyntax.DELETE_FAILED
if the operation failspublic java.lang.String toString()
DELETE
query based on the attributes of the
builder instancetoString
in class java.lang.Object
DELETE
query