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