public class SelectionBuilder extends Object
SQLiteDatabase
. Each
appended clause is combined using AND
. This class is not
thread safe.Constructor and Description |
---|
SelectionBuilder() |
Modifier and Type | Method and Description |
---|---|
SelectionBuilder |
append(String selection,
Object... selectionArgs)
Append the given selection clause to the internal state.
|
int |
delete(SQLiteDatabase db,
String table)
Execute delete using the current internal state as
WHERE clause. |
String |
getSelection()
Return selection string for current internal state.
|
String[] |
getSelectionArgs()
Return selection arguments for current internal state.
|
Cursor |
query(SQLiteDatabase db,
String table,
String[] columns,
String orderBy)
Execute query using the current internal state as
WHERE clause. |
Cursor |
query(SQLiteDatabase db,
String table,
String[] columns,
String groupBy,
String having,
String orderBy,
String limit)
Execute query using the current internal state as
WHERE clause. |
SelectionBuilder |
reset()
Reset any internal state, allowing this builder to be recycled.
|
int |
update(SQLiteDatabase db,
String table,
ContentValues values)
Execute update using the current internal state as
WHERE clause. |
public SelectionBuilder reset()
public SelectionBuilder append(String selection, Object... selectionArgs)
AND
.public String getSelection()
getSelectionArgs()
public String[] getSelectionArgs()
getSelection()
public Cursor query(SQLiteDatabase db, String table, String[] columns, String orderBy)
WHERE
clause.
Missing arguments as treated as null
.public Cursor query(SQLiteDatabase db, String table, String[] columns, String groupBy, String having, String orderBy, String limit)
WHERE
clause.public int update(SQLiteDatabase db, String table, ContentValues values)
WHERE
clause.public int delete(SQLiteDatabase db, String table)
WHERE
clause.