public class UpdateBuilder extends QueryBuilder<UpdateBuilder,java.lang.Integer>
UPDATE query.
int nUpdated = QueryBuilder.update( sTableName )
.setValues( vals )
.updateAll()
.executeOn( db )
;
Update specific rows, specifying that conflicts should be ignored.
int nUpdated = QueryBuilder.update( sTableName )
.setValues( vals )
.where( "some_column=?", sBogusValue )
.onConflict( SQLiteDatabase.CONFLICT_IGNORE )
.executeOn( db )
;
SQLiteDatabase.updateWithOnConflict(String, ContentValues, String, String[], int)QueryBuilder.UnboundException| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
LOG_TAG |
protected int |
m_zConflictAlgorithmID
The numeric ID of the conflict resolution algorithm provided by Android.
|
m_asExplicitWhereParams, m_dbTarget, m_sExplicitWhereFormat, m_sTableName, m_valsToWrite| Constructor and Description |
|---|
UpdateBuilder(java.lang.String sTableName) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
executeOn(android.database.sqlite.SQLiteDatabase db)
Executes an update query on the value that has been appended to the
builder.
|
UpdateBuilder |
onConflict(int zAlgorithmID)
Selects, by its numeric ID, the conflict resolution algorithm provided by
Android.
|
java.lang.String |
toString() |
UpdateBuilder |
updateAll()
Convenience grammar specifying that all rows should be updated.
|
deleteFrom, deleteFrom, execute, getWhereClause, getWhereFormat, getWhereParams, insertInto, insertInto, onDatabase, selectFrom, selectFrom, setTableName, setValues, toSQLInputParams, update, update, where, where, whereprotected static final java.lang.String LOG_TAG
protected int m_zConflictAlgorithmID
SQLiteDatabase.CONFLICT_ABORT,
SQLiteDatabase.CONFLICT_FAIL,
SQLiteDatabase.CONFLICT_IGNORE,
SQLiteDatabase.CONFLICT_NONE,
SQLiteDatabase.CONFLICT_REPLACE,
SQLiteDatabase.CONFLICT_ROLLBACKpublic UpdateBuilder updateAll()
public UpdateBuilder onConflict(int zAlgorithmID)
zAlgorithmID - the ID of the algorithm to usepublic java.lang.Integer executeOn(android.database.sqlite.SQLiteDatabase db)
executeOn in class QueryBuilder<UpdateBuilder,java.lang.Integer>db - the database instance on which the query should be executedSQLiteSyntax.UPDATE_FAILED if the update operation could not
proceedpublic java.lang.String toString()
toString in class java.lang.Object