add a data_version column to the data table

This commit is contained in:
Fred Quintana
2009-06-11 12:14:40 -07:00
parent 31ff7a366f
commit c933fb663e
2 changed files with 14 additions and 0 deletions

View File

@@ -369,6 +369,12 @@ public class ContentProviderOperation implements Parcelable {
/** Create a ContentProviderOperation from this {@link Builder}. */
public ContentProviderOperation build() {
if (mType == TYPE_UPDATE) {
if ((mValues == null || mValues.size() == 0)
&& (mValuesBackReferences == null || mValuesBackReferences.size() == 0)) {
throw new IllegalArgumentException("Empty values");
}
}
return new ContentProviderOperation(this);
}

View File

@@ -341,6 +341,14 @@ public final class ContactsContract {
*/
public static final String IS_RESTRICTED = "is_restricted";
/**
* The version of this data record. This is a read-only value. The data column is
* guaranteed to not change without the version going up. This value is monotonically
* increasing.
* <P>Type: INTEGER</P>
*/
public static final String DATA_VERSION = "data_version";
/** Generic data column, the meaning is {@link #MIMETYPE} specific */
public static final String DATA1 = "data1";
/** Generic data column, the meaning is {@link #MIMETYPE} specific */