public class UpdateBuilder extends QueryBuilder<UpdateBuilder,java.lang.Integer>
ContentResolver
and
Uri
.
Update all rows.
int nUpdated = QueryBuilder.update( rslv, uri ) .setValues( vals ) .updateAll() .execute() ;
Update specific rows.
int nUpdated = QueryBuilder.update( rslv, uri ) .setValues( vals ) .where( "some_column=?", sSomeValue ) .execute() ;
QueryBuilder.ExecutionException, QueryBuilder.UnboundException
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOG_TAG |
m_asExplicitWhereParams, m_rslv, m_sExplicitWhereFormat, m_uri, m_valsToWrite
Constructor and Description |
---|
UpdateBuilder() |
UpdateBuilder(android.content.ContentResolver rslv,
android.net.Uri uri) |
UpdateBuilder(android.content.Context ctx,
android.net.Uri uri) |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
executeQuery(android.content.ContentResolver rslv,
android.net.Uri uri)
Consumed by
QueryBuilder.execute() and QueryBuilder.executeOn(android.content.ContentResolver, android.net.Uri) to actually carry out
the operation. |
UpdateBuilder |
updateAll()
Convenience grammar specifying that all rows should be updated.
|
delete, deleteFrom, deleteFrom, execute, executeOn, executeOn, getContentResolver, getWhereFormat, getWhereParams, insert, insertInto, insertInto, onDataSource, onDataSource, select, selectFrom, selectFrom, setValues, update, update, update, validateDataContextBinding, where, where, where
public UpdateBuilder(android.content.ContentResolver rslv, android.net.Uri uri)
public UpdateBuilder(android.content.Context ctx, android.net.Uri uri)
public UpdateBuilder()
public UpdateBuilder updateAll()
public java.lang.Integer executeQuery(android.content.ContentResolver rslv, android.net.Uri uri) throws java.lang.Exception
QueryBuilder
QueryBuilder.execute()
and QueryBuilder.executeOn(android.content.ContentResolver, android.net.Uri)
to actually carry out
the operation. In the implementation class, this method should consist
solely of the ContentResolver
query method call, plus any other
pre-checks which might be able to short-circuit the query execution.executeQuery
in class QueryBuilder<UpdateBuilder,java.lang.Integer>
rslv
- the resolver through which the query should be executeduri
- the URI at which the query should be executedjava.lang.Exception
- if anything goes wrong