Implement getLong for ContentValuesCursor.

This is required because SQLite "rowids" are 64 bit integers:

> all rows within SQLite tables have a 64-bit signed integer
> key that uniquely identifies the row within its table."

https://sqlite.org/lang_createtable.html#rowid
This commit is contained in:
Peter Serwylo 2016-06-27 22:23:35 +10:00
parent 2733081b3a
commit 6e3b1fde86

View File

@ -65,7 +65,10 @@ class ContentValuesCursor extends AbstractCursor {
@Override
public long getLong(int i) {
throw new IllegalArgumentException("unimplemented");
if (values[i] instanceof Long) {
return (Long) values[i];
}
throw new IllegalArgumentException("Value is not a Long");
}
@Override