added in version 1.1.0
belongs to Maven artifact android.arch.persistence:db:1.1.0-beta2

SupportSQLiteQueryBuilder

public final class SupportSQLiteQueryBuilder
extends Object

java.lang.Object
   ↳ android.arch.persistence.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 SupportSQLiteQuery that can be passed into query(SupportSQLiteQuery).

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

added in version 1.1.0
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

added in version 1.1.0
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

added in version 1.1.0
SupportSQLiteQuery create ()

Creates the SupportSQLiteQuery that can be passed into query(SupportSQLiteQuery).

Returns
SupportSQLiteQuery a new query

distinct

added in version 1.1.0
SupportSQLiteQueryBuilder distinct ()

Adds DISTINCT keyword to the query.

Returns
SupportSQLiteQueryBuilder this

groupBy

added in version 1.1.0
SupportSQLiteQueryBuilder groupBy (String groupBy)

Adds a GROUP BY statement.

Parameters
groupBy String: The value of the GROUP BY statement.

Returns
SupportSQLiteQueryBuilder this

having

added in version 1.1.0
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

added in version 1.1.0
SupportSQLiteQueryBuilder limit (String limit)

Adds a LIMIT statement.

Parameters
limit String: The limit value.

Returns
SupportSQLiteQueryBuilder this

orderBy

added in version 1.1.0
SupportSQLiteQueryBuilder orderBy (String orderBy)

Adds an ORDER BY statement.

Parameters
orderBy String: The order clause.

Returns
SupportSQLiteQueryBuilder this

selection

added in version 1.1.0
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