From 6eb7c45a8fdb774c4094b5012c8496f2a009c032 Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Wed, 27 Jan 2010 14:31:24 -0800 Subject: [PATCH] make SqliteDatabase ConflictAlgorithm and associated methods public. SQLiteDatabase.java has ConflictAlgorithm which allows callers to specify actions to take when insert or update causes constraint violations. These actions are documented at http://www.sqlite.org/lang_conflict.html. why make these public? usecase is the following: Gmail has a table with a column "_id" being the integer primary key and they let sqlite assign key values to the column. but there is another UNIQUE key column (message_id) in the table. so an insert could fail due to constraint violation on the message_id column (i.e., not on the primary key). and when that happens, they would like to get the value of _id that caused constraint violation. currently hidden method insertOnConflict() already provides the above functionality. that means exposing ConflictAlgorithm also. --- api/current.xml | 115 ++++++++++++++++++ .../database/sqlite/SQLiteDatabase.java | 61 ++++------ 2 files changed, 142 insertions(+), 34 deletions(-) diff --git a/api/current.xml b/api/current.xml index b03f826e13d98..fe373183f082b 100644 --- a/api/current.xml +++ b/api/current.xml @@ -52371,6 +52371,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +