net.sqlcipher.Cursor Java Examples

The following examples show how to use net.sqlcipher.Cursor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SearchDatabase.java    From mollyim-android with GNU General Public License v3.0 6 votes vote down vote up
public Cursor queryMessages(@NonNull String query, long threadId) {
  SQLiteDatabase db                  = databaseHelper.getReadableDatabase();
  String         fullTextSearchQuery = createFullTextSearchQuery(query);

  if (TextUtils.isEmpty(fullTextSearchQuery)) {
    return null;
  }

  Cursor cursor = db.rawQuery(MESSAGES_FOR_THREAD_QUERY, new String[] { fullTextSearchQuery,
                                                                        String.valueOf(threadId),
                                                                        fullTextSearchQuery,
                                                                        String.valueOf(threadId) });

  setNotifyConverationListListeners(cursor);
  return cursor;
}
 
Example #2
Source File: HybridFileBackedSqlHelpers.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
protected static String getEntryFilename(AndroidDbHelper helper,
                                         String table, int id) {
    Cursor c;
    SQLiteDatabase db = helper.getHandle();

    String[] columns = new String[]{DatabaseHelper.FILE_COL};
    c = db.query(table, columns, DatabaseHelper.ID_COL + "=?",
            new String[]{String.valueOf(id)}, null, null, null);

    try {
        c.moveToFirst();
        return c.getString(c.getColumnIndexOrThrow(DatabaseHelper.FILE_COL));
    } finally {
        if (c != null) {
            c.close();
        }
    }
}
 
Example #3
Source File: HybridFileBackedSqlHelpers.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
protected static Pair<String, byte[]> getEntryFilenameAndKey(AndroidDbHelper helper,
                                                             String table,
                                                             int id) {
    Cursor c;
    c = helper.getHandle().query(table, HybridFileBackedSqlStorage.dataColumns,
            DatabaseHelper.ID_COL + "=?",
            new String[]{String.valueOf(id)}, null, null, null);

    try {
        c.moveToFirst();
        return new Pair<>(c.getString(c.getColumnIndexOrThrow(DatabaseHelper.FILE_COL)),
                c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.AES_COL)));
    } finally {
        if (c != null) {
            c.close();
        }
    }
}
 
Example #4
Source File: IndexedFixturePathUtils.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
public static List<String> getAllIndexedFixtureNames(SQLiteDatabase db) {
    Cursor c = db.query(INDEXED_FIXTURE_PATHS_TABLE,
            new String[]{INDEXED_FIXTURE_PATHS_COL_NAME},
            null, null, null, null, null);
    List<String> fixtureNames = new ArrayList<>();
    try {
        if (c.moveToFirst()) {
            int desiredColumnIndex = c.getColumnIndexOrThrow(
                    INDEXED_FIXTURE_PATHS_COL_NAME);
            while (!c.isAfterLast()) {
                String name = c.getString(desiredColumnIndex);
                fixtureNames.add(name);
                c.moveToNext();
            }
        }
        return fixtureNames;
    } finally {
        if (c != null) {
            c.close();
        }
    }
}
 
Example #5
Source File: IndexedFixturePathUtils.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
public static IndexedFixtureIdentifier lookupIndexedFixturePaths(SQLiteDatabase db,
                                                                 String fixtureName) {
    Cursor c = db.query(INDEXED_FIXTURE_PATHS_TABLE,
            new String[]{INDEXED_FIXTURE_PATHS_COL_BASE, INDEXED_FIXTURE_PATHS_COL_CHILD, INDEXED_FIXTURE_PATHS_COL_ATTRIBUTES},
            INDEXED_FIXTURE_PATHS_COL_NAME + "=?", new String[]{fixtureName}, null, null, null);
    try {
        if (c.getCount() == 0) {
            return null;
        } else {
            c.moveToFirst();
            return new IndexedFixtureIdentifier(
                    c.getString(c.getColumnIndexOrThrow(INDEXED_FIXTURE_PATHS_COL_BASE)),
                    c.getString(c.getColumnIndexOrThrow(INDEXED_FIXTURE_PATHS_COL_CHILD)),
                    c.getBlob(c.getColumnIndexOrThrow(INDEXED_FIXTURE_PATHS_COL_ATTRIBUTES)));
        }
    } finally {
        c.close();
    }
}
 
Example #6
Source File: AndroidCaseIndexTable.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
/**
 * Get a list of Case Record id's for cases which index any of a set of provided values
 *
 * @param indexName      The name of the index
 * @param targetValueSet The set of cases targeted by the index
 * @return An integer array of indexed case record ids
 */
public LinkedHashSet<Integer> getCasesMatchingValueSet(String indexName, String[] targetValueSet) {
    String[] args = new String[1 + targetValueSet.length];
    args[0] = indexName;
    for (int i = 0; i < targetValueSet.length; ++i) {
        args[i + 1] = targetValueSet[i];
    }
    String inSet = getArgumentBasedVariableSet(targetValueSet.length);

    String whereExpr = String.format("%s = ? AND %s IN %s", COL_INDEX_NAME, COL_INDEX_TARGET, inSet);

    if (SqlStorage.STORAGE_OUTPUT_DEBUG) {
        String query = String.format("SELECT %s FROM %s WHERE %s", COL_CASE_RECORD_ID, TABLE_NAME, whereExpr);
        DbUtil.explainSql(db, query, args);
    }

    Cursor c = db.query(TABLE_NAME, new String[]{COL_CASE_RECORD_ID}, whereExpr, args, null, null, null);
    LinkedHashSet<Integer> ret = new LinkedHashSet<>();

    SqlStorage.fillIdWindow(c, COL_CASE_RECORD_ID, ret);
    return ret;
}
 
Example #7
Source File: FixtureSerializationMigration.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
private static boolean doesTempFixtureTableExist(SQLiteDatabase db) {
    // "SELECT name FROM sqlite_master WHERE type='table' AND name='oldfixture';";
    String whereClause = "type =? AND name =?";
    String[] whereArgs = new String[]{
            "table",
            "oldfixture"
    };
    Cursor cursor = null;
    try {
        cursor = db.query("sqlite_master", new String[]{"name"},
                whereClause, whereArgs, null, null, null);
        return cursor.getCount() > 0;
    } finally {
        if (cursor != null) {
            cursor.close();
        }
    }
}
 
Example #8
Source File: HybridFileBackedSqlHelpers.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
/**
 * Remove files in the orphaned file table. Files are added to this table
 * when file-backed db transactions fail, leaving the file on the
 * filesystem.
 *
 * Order of operations expects filenames to be globally unique.
 */
public static void removeOrphanedFiles(SQLiteDatabase db) {
    Cursor cur = db.query(DbUtil.orphanFileTableName, new String[]{DatabaseHelper.FILE_COL}, null, null, null, null, null);
    ArrayList<String> files = new ArrayList<>();
    try {
        if (cur.getCount() > 0) {
            cur.moveToFirst();
            int fileColIndex = cur.getColumnIndexOrThrow(DatabaseHelper.FILE_COL);
            while (!cur.isAfterLast()) {
                files.add(cur.getString(fileColIndex));
                cur.moveToNext();
            }
        }
    } finally {
        if (cur != null) {
            cur.close();
        }
    }

    removeFiles(files);

    db.beginTransaction();
    try {
        db.delete(DbUtil.orphanFileTableName, null, null);
        db.setTransactionSuccessful();
    } finally {
        db.endTransaction();
    }
}
 
Example #9
Source File: SearchDatabase.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
public Cursor queryMessages(@NonNull String query) {
  SQLiteDatabase db                  = databaseHelper.getReadableDatabase();
  String         fullTextSearchQuery = createFullTextSearchQuery(query);

  if (TextUtils.isEmpty(fullTextSearchQuery)) {
    return null;
  }

  Cursor cursor = db.rawQuery(MESSAGES_QUERY, new String[] { fullTextSearchQuery,
                                                             fullTextSearchQuery });

  setNotifyConverationListListeners(cursor);
  return cursor;
}
 
Example #10
Source File: AndroidCaseIndexTable.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
public int loadIntoIndexTable(HashMap<String, Vector<Integer>> indexCache, String indexName) {
    int resultsReturned = 0;
    String[] args = new String[]{indexName};
    if (SqlStorage.STORAGE_OUTPUT_DEBUG) {
        String query = String.format("SELECT %s,%s %s FROM %s where %s = '%s'", COL_CASE_RECORD_ID, COL_INDEX_NAME, COL_INDEX_TARGET, TABLE_NAME, COL_INDEX_NAME, indexName);
        DbUtil.explainSql(db, query, null);
    }

    Cursor c = db.query(TABLE_NAME, new String[]{COL_CASE_RECORD_ID, COL_INDEX_NAME, COL_INDEX_TARGET},COL_INDEX_NAME + " = ?", args, null, null, null);

    try {
        if (c.moveToFirst()) {
            while (!c.isAfterLast()) {
                resultsReturned++;
                int id = c.getInt(c.getColumnIndexOrThrow(COL_CASE_RECORD_ID));
                String target = c.getString(c.getColumnIndexOrThrow(COL_INDEX_TARGET));

                String cacheID = indexName + "|" + target;
                Vector<Integer> cache;
                if (indexCache.containsKey(cacheID)){
                    cache = indexCache.get(cacheID);
                } else {
                    cache = new Vector<>();
                }
                cache.add(id);
                indexCache.put(cacheID, cache);
                c.moveToNext();
            }
        }

        return resultsReturned;
    } finally {
        if (c != null) {
            c.close();
        }
    }

}
 
Example #11
Source File: AndroidCaseIndexTable.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
/**
 * Get a list of Case Record id's for cases which index a provided value.
 *
 * @param indexName   The name of the index
 * @param targetValue The case targeted by the index
 * @return An integer array of indexed case record ids
 */
public LinkedHashSet<Integer> getCasesMatchingIndex(String indexName, String targetValue) {
    String[] args = new String[]{indexName, targetValue};
    if (SqlStorage.STORAGE_OUTPUT_DEBUG) {
        String query = String.format("SELECT %s FROM %s WHERE %s = ? AND %s = ?", COL_CASE_RECORD_ID, TABLE_NAME, COL_INDEX_NAME, COL_INDEX_TARGET);
        DbUtil.explainSql(db, query, args);
    }
    Cursor c = db.query(TABLE_NAME, new String[]{COL_CASE_RECORD_ID}, COL_INDEX_NAME + " = ? AND " + COL_INDEX_TARGET + " =  ?", args, null, null, null);
    LinkedHashSet<Integer> ret = new LinkedHashSet<>();
    SqlStorage.fillIdWindow(c, COL_CASE_RECORD_ID, ret);
    return ret;
}
 
Example #12
Source File: AndroidCaseIndexTable.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
public HashMap<Integer,Vector<Pair<String, String>>> getCaseIndexMap() {
    String[] projection = new String[] {COL_CASE_RECORD_ID, COL_INDEX_TARGET, COL_INDEX_RELATIONSHIP};
    HashMap<Integer,Vector<Pair<String, String>>> caseIndexMap = new HashMap<>();
    Cursor c = db.query(TABLE_NAME, projection, null ,null, null, null, null);

    int recordColumn = c.getColumnIndexOrThrow(COL_CASE_RECORD_ID);
    int targetColumn = c.getColumnIndexOrThrow(COL_INDEX_TARGET);
    int relationshipColumn = c.getColumnIndexOrThrow(COL_INDEX_RELATIONSHIP);

    try {
        c.moveToFirst();
        while (!c.isAfterLast()) {
            int caseRecordId = c.getInt(recordColumn);
            String targetCase = c.getString(targetColumn);
            String relationship = c.getString(relationshipColumn);

            c.moveToNext();

            Pair<String, String> index  = new Pair<> (targetCase, relationship);

            Vector<Pair<String, String>> indexList;
            if (!caseIndexMap.containsKey(caseRecordId)) {
                indexList = new Vector<>();
            } else {
                indexList = caseIndexMap.get(caseRecordId);
            }
            indexList.add(index);
            caseIndexMap.put(caseRecordId, indexList);
        }

        return caseIndexMap;
    } finally {
        c.close();
    }
}
 
Example #13
Source File: EntityStorageCache.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
public String retrieveCacheValue(String entityKey, String cacheKey) {
    String whereClause = String.format("%s = ? AND %s = ? AND %s = ? AND %s = ?", COL_APP_ID, COL_CACHE_NAME, COL_ENTITY_KEY, COL_CACHE_KEY);

    Cursor c = db.query(TABLE_NAME, new String[]{COL_VALUE}, whereClause, new String[]{mAppId, mCacheName, entityKey, cacheKey}, null, null, null);
    try {
        if (c.moveToNext()) {
            return c.getString(0);
        } else {
            return null;
        }
    } finally {
        c.close();
    }
}
 
Example #14
Source File: AsyncNodeEntityFactory.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
private void populateEntitySet(SQLiteDatabase db, String sqlStatement, String[] args) {
    //TODO: This will _only_ query up to about a meg of data, which is an un-great limitation.
    //Should probably split this up SQL LIMIT based looped
    //For reference the current limitation is about 10k rows with 1 field each.
    Cursor walker = db.rawQuery(sqlStatement, args);
    while (walker.moveToNext()) {
        String entityId = walker.getString(walker.getColumnIndex("entity_key"));
        String cacheId = walker.getString(walker.getColumnIndex("cache_key"));
        String val = walker.getString(walker.getColumnIndex("value"));
        if (this.mEntitySet.containsKey(entityId)) {
            this.mEntitySet.get(entityId).setSortData(cacheId, val);
        }
    }
    walker.close();
}
 
Example #15
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 4 votes vote down vote up
@Override
public android.database.Cursor query(final SupportSQLiteQuery supportQuery, CancellationSignal cancellationSignal) {
	throw (new RuntimeException("Not implements"));
}
 
Example #16
Source File: AndroidCaseIndexTable.java    From commcare-android with Apache License 2.0 4 votes vote down vote up
/**
 * Provided an index name and a list of case row ID's, provides a list of the row ID's of the
 * cases which point to that ID
 * @param cuedCases
 * @return
 */
public DualTableSingleMatchModelQuerySet bulkReadIndexToCaseIdMatch(String indexName, Collection<Integer> cuedCases) {
    DualTableSingleMatchModelQuerySet set = new DualTableSingleMatchModelQuerySet();
    String caseIdIndex = TableBuilder.scrubName(Case.INDEX_CASE_ID);

    //NOTE: This is possibly slower than it appears. I think the cast screws up sqlites's
    //ability to do an indexed match
    List<Pair<String, String[]>> whereParamList = TableBuilder.sqlList(cuedCases, "CAST(? as INT)");
    for (Pair<String, String[]> querySet : whereParamList) {

        String query =String.format(
                "SELECT %s,%s " +
                        "FROM %s " +
                        "INNER JOIN %s " +
                        "ON %s = %s " +
                        "WHERE %s = '%s' " +
                        "AND " +
                        "%s IN %s",

                COL_CASE_RECORD_ID, ACase.STORAGE_KEY + "." + DatabaseHelper.ID_COL,
                TABLE_NAME,
                ACase.STORAGE_KEY,
                COL_INDEX_TARGET, caseIdIndex,
                COL_INDEX_NAME, indexName,
                COL_CASE_RECORD_ID, querySet.first);

        android.database.Cursor c = db.rawQuery(query, querySet.second);

        try {
            if (c.getCount() == 0) {
                return set;
            } else {
                c.moveToFirst();
                while (!c.isAfterLast()) {
                    int caseId = c.getInt(c.getColumnIndexOrThrow(COL_CASE_RECORD_ID));
                    int targetCase = c.getInt(c.getColumnIndex(DatabaseHelper.ID_COL));
                    set.loadResult(caseId, targetCase);
                    c.moveToNext();
                }
            }
        } finally {
            c.close();
        }
    }
    return set;
}
 
Example #17
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Runs the provided SQL and returns a cursor over the result set. The
 * cursor will read an initial set of rows and the return to the caller. It
 * will continue to read in batches and send data changed notifications when
 * the later batches are ready.
 * 
 * @param sql
 *            the SQL query. The SQL string must not be ; terminated
 * @param selectionArgs
 *            You may include ?s in where clause in the query, which will be
 *            replaced by the values from selectionArgs. The values will be
 *            bound as Strings.
 * @param initialRead
 *            set the initial count of items to read from the cursor
 * @param maxRead
 *            set the count of items to read on each iteration after the
 *            first
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 *         This work is incomplete and not fully tested or reviewed, so
 *         currently hidden.
 * @hide
 */
public Cursor rawQuery(String sql, String[] selectionArgs, int initialRead, int maxRead) {
	throw (new RuntimeException("Not implements"));
}
 
Example #18
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Runs the provided SQL and returns a cursor over the result set.
 *
 * @param cursorFactory
 *            the cursor factory to use, or null for the default factory
 * @param sql
 *            the SQL query. The SQL string must not be ; terminated
 * @param selectionArgs
 *            You may include ?s in where clause in the query, which will be
 *            replaced by the values from selectionArgs. The values will be
 *            bound as Strings.
 * @param editTable
 *            the name of the first table, which is editable
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @throws SQLiteException
 *             if there is an issue executing the sql or the SQL string is
 *             invalid
 * @throws IllegalStateException
 *             if the database is not open
 */
public Cursor rawQueryWithFactory(CursorFactory cursorFactory, String sql, String[] selectionArgs,
		String editTable) {
	throw (new RuntimeException("Not implements"));
}
 
Example #19
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Runs the provided SQL and returns a {@link Cursor} over the result set.
 *
 * @param sql
 *            the SQL query. The SQL string must not be ; terminated
 * @param args
 *            You may include ?s in where clause in the query, which will be
 *            replaced by the values from args. The values will be bound by
 *            their type.
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @throws SQLiteException
 *             if there is an issue executing the sql or the SQL string is
 *             invalid
 * @throws IllegalStateException
 *             if the database is not open
 */
public Cursor rawQuery(String sql, Object[] args) {
	throw (new RuntimeException("Not implements"));
}
 
Example #20
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Runs the provided SQL and returns a {@link Cursor} over the result set.
 *
 * @param sql
 *            the SQL query. The SQL string must not be ; terminated
 * @param selectionArgs
 *            You may include ?s in where clause in the query, which will be
 *            replaced by the values from selectionArgs. The values will be
 *            bound as Strings.
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @throws SQLiteException
 *             if there is an issue executing the sql or the SQL string is
 *             invalid
 * @throws IllegalStateException
 *             if the database is not open
 */
public Cursor rawQuery(String sql, String[] selectionArgs) {
	throw (new RuntimeException("Not implements"));
}
 
Example #21
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Query the given table, returning a {@link Cursor} over the result set.
 *
 * @param table
 *            The table name to compile the query against.
 * @param columns
 *            A list of which columns to return. Passing null will return
 *            all columns, which is discouraged to prevent reading data from
 *            storage that isn't going to be used.
 * @param selection
 *            A filter declaring which rows to return, formatted as an SQL
 *            WHERE clause (excluding the WHERE itself). Passing null will
 *            return all rows for the given table.
 * @param selectionArgs
 *            You may include ?s in selection, which will be replaced by the
 *            values from selectionArgs, in order that they appear in the
 *            selection. The values will be bound as Strings.
 * @param groupBy
 *            A filter declaring how to group rows, formatted as an SQL
 *            GROUP BY clause (excluding the GROUP BY itself). Passing null
 *            will cause the rows to not be grouped.
 * @param having
 *            A filter declare which row groups to include in the cursor, if
 *            row grouping is being used, formatted as an SQL HAVING clause
 *            (excluding the HAVING itself). Passing null will cause all row
 *            groups to be included, and is required when row grouping is
 *            not being used.
 * @param orderBy
 *            How to order the rows, formatted as an SQL ORDER BY clause
 *            (excluding the ORDER BY itself). Passing null will use the
 *            default sort order, which may be unordered.
 * @param limit
 *            Limits the number of rows returned by the query, formatted as
 *            LIMIT clause. Passing null denotes no LIMIT clause.
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @throws SQLiteException
 *             if there is an issue executing the sql or the SQL string is
 *             invalid
 * @throws IllegalStateException
 *             if the database is not open
 *
 * @see Cursor
 */
public Cursor query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy,
		String having, String orderBy, String limit) {

	throw (new RuntimeException("Not implements"));
}
 
Example #22
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Query the given table, returning a {@link Cursor} over the result set.
 *
 * @param table
 *            The table name to compile the query against.
 * @param columns
 *            A list of which columns to return. Passing null will return
 *            all columns, which is discouraged to prevent reading data from
 *            storage that isn't going to be used.
 * @param selection
 *            A filter declaring which rows to return, formatted as an SQL
 *            WHERE clause (excluding the WHERE itself). Passing null will
 *            return all rows for the given table.
 * @param selectionArgs
 *            You may include ?s in selection, which will be replaced by the
 *            values from selectionArgs, in order that they appear in the
 *            selection. The values will be bound as Strings.
 * @param groupBy
 *            A filter declaring how to group rows, formatted as an SQL
 *            GROUP BY clause (excluding the GROUP BY itself). Passing null
 *            will cause the rows to not be grouped.
 * @param having
 *            A filter declare which row groups to include in the cursor, if
 *            row grouping is being used, formatted as an SQL HAVING clause
 *            (excluding the HAVING itself). Passing null will cause all row
 *            groups to be included, and is required when row grouping is
 *            not being used.
 * @param orderBy
 *            How to order the rows, formatted as an SQL ORDER BY clause
 *            (excluding the ORDER BY itself). Passing null will use the
 *            default sort order, which may be unordered.
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @throws SQLiteException
 *             if there is an issue executing the sql or the SQL string is
 *             invalid
 * @throws IllegalStateException
 *             if the database is not open
 *
 * @see Cursor
 */
public Cursor query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy,
		String having, String orderBy) {

	throw (new RuntimeException("Not implements"));
}
 
Example #23
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Query the given URL, returning a {@link Cursor} over the result set.
 *
 * @param cursorFactory
 *            the cursor factory to use, or null for the default factory
 * @param distinct
 *            true if you want each row to be unique, false otherwise.
 * @param table
 *            The table name to compile the query against.
 * @param columns
 *            A list of which columns to return. Passing null will return
 *            all columns, which is discouraged to prevent reading data from
 *            storage that isn't going to be used.
 * @param selection
 *            A filter declaring which rows to return, formatted as an SQL
 *            WHERE clause (excluding the WHERE itself). Passing null will
 *            return all rows for the given table.
 * @param selectionArgs
 *            You may include ?s in selection, which will be replaced by the
 *            values from selectionArgs, in order that they appear in the
 *            selection. The values will be bound as Strings.
 * @param groupBy
 *            A filter declaring how to group rows, formatted as an SQL
 *            GROUP BY clause (excluding the GROUP BY itself). Passing null
 *            will cause the rows to not be grouped.
 * @param having
 *            A filter declare which row groups to include in the cursor, if
 *            row grouping is being used, formatted as an SQL HAVING clause
 *            (excluding the HAVING itself). Passing null will cause all row
 *            groups to be included, and is required when row grouping is
 *            not being used.
 * @param orderBy
 *            How to order the rows, formatted as an SQL ORDER BY clause
 *            (excluding the ORDER BY itself). Passing null will use the
 *            default sort order, which may be unordered.
 * @param limit
 *            Limits the number of rows returned by the query, formatted as
 *            LIMIT clause. Passing null denotes no LIMIT clause.
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @see Cursor
 */
public Cursor queryWithFactory(CursorFactory cursorFactory, boolean distinct, String table, String[] columns,
		String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit) {
	throw (new RuntimeException("Not implements"));
}
 
Example #24
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * Query the given URL, returning a {@link Cursor} over the result set.
 *
 * @param distinct
 *            true if you want each row to be unique, false otherwise.
 * @param table
 *            The table name to compile the query against.
 * @param columns
 *            A list of which columns to return. Passing null will return
 *            all columns, which is discouraged to prevent reading data from
 *            storage that isn't going to be used.
 * @param selection
 *            A filter declaring which rows to return, formatted as an SQL
 *            WHERE clause (excluding the WHERE itself). Passing null will
 *            return all rows for the given table.
 * @param selectionArgs
 *            You may include ?s in selection, which will be replaced by the
 *            values from selectionArgs, in order that they appear in the
 *            selection. The values will be bound as Strings.
 * @param groupBy
 *            A filter declaring how to group rows, formatted as an SQL
 *            GROUP BY clause (excluding the GROUP BY itself). Passing null
 *            will cause the rows to not be grouped.
 * @param having
 *            A filter declare which row groups to include in the cursor, if
 *            row grouping is being used, formatted as an SQL HAVING clause
 *            (excluding the HAVING itself). Passing null will cause all row
 *            groups to be included, and is required when row grouping is
 *            not being used.
 * @param orderBy
 *            How to order the rows, formatted as an SQL ORDER BY clause
 *            (excluding the ORDER BY itself). Passing null will use the
 *            default sort order, which may be unordered.
 * @param limit
 *            Limits the number of rows returned by the query, formatted as
 *            LIMIT clause. Passing null denotes no LIMIT clause.
 *
 * @return A {@link Cursor} object, which is positioned before the first
 *         entry. Note that {@link Cursor}s are not synchronized, see the
 *         documentation for more details.
 *
 * @throws SQLiteException
 *             if there is an issue executing the sql or the SQL string is
 *             invalid
 * @throws IllegalStateException
 *             if the database is not open
 *
 * @see Cursor
 */
public Cursor query(boolean distinct, String table, String[] columns, String selection, String[] selectionArgs,
		String groupBy, String having, String orderBy, String limit) {
	throw (new RuntimeException("Not implements"));
}
 
Example #25
Source File: SQLiteDatabase.java    From kripton with Apache License 2.0 2 votes vote down vote up
/**
 * See
 * {@link SQLiteCursor#SQLiteCursor(SQLiteDatabase, SQLiteCursorDriver, String, SQLiteQuery)}.
 */
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query);