protected static ArrayList<DBExtension> getAll(final SQLiteDatabase db, final DBExtensionType type, @Nullable final String key) {
            return withAccessLock(() -> {
                checkState(type, key, true);
                final ArrayList<DBExtension> result = new ArrayList<>();
                try (Cursor cursor = db.query(dbTableExtension,
                        new String[]{"_id", "_key", "long1", "long2", "long3", "long4", "string1", "string2", "string3", "string4"},
                        "_type = ?" + (null == key ? "" : " AND _key LIKE ?"),
                        null == key ? new String[]{String.valueOf(type.id)} : new String[]{String.valueOf(type.id), key},
                        null, null, "_id", null)) {
                    while (cursor.moveToNext()) {
                        result.add(new DBExtension(cursor.getLong(0), cursor.getString(1), cursor.getLong(2), cursor.getLong(3), cursor.getLong(4), cursor.getLong(5), cursor.getString(6), cursor.getString(7), cursor.getString(8), cursor.getString(9)));
                    }
                }
                return result;
            });
        }
get a list of all entries for this key (if key != null) / for this type (if key is null)
main/src/main/java/cgeo/geocaching/storage/DataStore.java