SupportSQLiteQueryBuilder
public
final
class
SupportSQLiteQueryBuilder
extends Object
| java.lang.Object | |
| ↳ | androidx.sqlite.db.SupportSQLiteQueryBuilder |
A simple query builder to create SQL SELECT queries.
Summary
Public methods | |
|---|---|
static
SupportSQLiteQueryBuilder
|
builder(String tableName)
Creates a query for the given table name. |
SupportSQLiteQueryBuilder
|
columns(String[] columns)
Sets the given list of columns as the columns that will be returned. |
SupportSQLiteQuery
|
create()
Creates the |
SupportSQLiteQueryBuilder
|
distinct()
Adds DISTINCT keyword to the query. |
SupportSQLiteQueryBuilder
|
groupBy(String groupBy)
Adds a GROUP BY statement. |
SupportSQLiteQueryBuilder
|
having(String having)
Adds a HAVING statement. |
SupportSQLiteQueryBuilder
|
limit(String limit)
Adds a LIMIT statement. |
SupportSQLiteQueryBuilder
|
orderBy(String orderBy)
Adds an ORDER BY statement. |
SupportSQLiteQueryBuilder
|
selection(String selection, Object[] bindArgs)
Sets the arguments for the WHERE clause. |
Inherited methods | |
|---|---|
Public methods
builder
public static SupportSQLiteQueryBuilder builder (String tableName)
Creates a query for the given table name.
| Parameters | |
|---|---|
tableName |
String: The table name(s) to query. |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
A builder to create a query. |
columns
public SupportSQLiteQueryBuilder columns (String[] columns)
Sets the given list of columns as the columns that will be returned.
| Parameters | |
|---|---|
columns |
String: The list of column names that should be returned. |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |
create
public SupportSQLiteQuery create ()
Creates the SupportSQLiteQuery that can be passed into
SupportSQLiteDatabase.query(SupportSQLiteQuery).
| Returns | |
|---|---|
SupportSQLiteQuery |
a new query |
distinct
public SupportSQLiteQueryBuilder distinct ()
Adds DISTINCT keyword to the query.
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |
groupBy
public SupportSQLiteQueryBuilder groupBy (String groupBy)
Adds a GROUP BY statement.
| Parameters | |
|---|---|
groupBy |
String: The value of the GROUP BY statement. |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |
having
public SupportSQLiteQueryBuilder having (String having)
Adds a HAVING statement. You must also provide groupBy(String) for this to work.
| Parameters | |
|---|---|
having |
String: The having clause. |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |
limit
public SupportSQLiteQueryBuilder limit (String limit)
Adds a LIMIT statement.
| Parameters | |
|---|---|
limit |
String: The limit value. |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |
orderBy
public SupportSQLiteQueryBuilder orderBy (String orderBy)
Adds an ORDER BY statement.
| Parameters | |
|---|---|
orderBy |
String: The order clause. |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |
selection
public SupportSQLiteQueryBuilder selection (String selection, Object[] bindArgs)
Sets the arguments for the WHERE clause.
| Parameters | |
|---|---|
selection |
String: The list of selection columns |
bindArgs |
Object: The list of bind arguments to match against these columns |
| Returns | |
|---|---|
SupportSQLiteQueryBuilder |
this |