mardi 14 juillet 2015

How can (or should) I map `BaseColumns._ID` to `ROWID`, `_ROWID_`, or `OID`?

I'm using BaseColumns to create a databases with sqlite on Android. This class comes with a final variable _ID = "_id"; to (I think) standardize the name of a column of row id's SO answer about this. However sqlite usually does not need this, since it internally maintains a row id, accessible as any other column through the names ROWID, _ROWID_, or OID.

For me, it seems logic to map BaseColumns._ID to one of this virtual columns, however since its a final variable, I don't see a straightforward approach.

How can (or should) I map BaseColumns._ID to ROWID, _ROWID_, or OID?

Aucun commentaire:

Enregistrer un commentaire