本文整理汇总了Java中android.database.sqlite.SQLiteQuery类的典型用法代码示例。如果您正苦于以下问题:Java SQLiteQuery类的具体用法?Java SQLiteQuery怎么用?Java SQLiteQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SQLiteQuery类属于android.database.sqlite包,在下文中一共展示了SQLiteQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver driver,
String editTable, SQLiteQuery query) {
// Create a standard cursor
Cursor cursor = new SQLiteCursor(driver, editTable, query);
// Check if there is an edit table
if (editTable != null) {
// Check if the table has a cursor wrapper
GeoPackageCursorWrapper cursorWrapper = tableCursors.get(editTable);
if (cursorWrapper != null) {
cursor = cursorWrapper.wrapCursor(cursor);
}
}
return cursor;
}
示例2: openDatabase
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
public SQLiteDatabase openDatabase(final File dbFile) {
return SQLiteDatabase.openDatabase(dbFile.getAbsolutePath(), new SQLiteDatabase.CursorFactory() {
@Override
@SuppressWarnings("deprecation")
public Cursor newCursor(final SQLiteDatabase db, SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
return new SQLiteCursor(db, driver, editTable, query) {
@Override
public void close() {
Log.d(TAG, "closing cursor");
super.close();
db.close();
if (!dbFile.delete()) {
Log.w(TAG, "could not delete database " + dbFile);
}
}
};
}
}, SQLiteDatabase.OPEN_READWRITE);
}
示例3: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query) {
Cursor cursor = CURSOR_FACTORY.newCursor(db, masterQuery, editTable, query);
long start = System.currentTimeMillis();
cursor.getCount(); // to fill window
long end = System.currentTimeMillis();
long elapsed = end - start;
if (elapsed > mQueryTimeLimit) {
// ugly hack warning, the next line depends on current SQLiteQuery implementation:
String queryString = query.toString().substring("SQLiteQuery: ".length());
List<String> queryPlan = mQueryPlanGetter.getQueryPlan(db, queryString, editTable);
dumpIssueReport(queryString, queryPlan, elapsed);
}
return cursor;
}
示例4: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public final Cursor newCursor(final SQLiteDatabase pDb,
final SQLiteCursorDriver pMasterQuery, final String pEditTable,
final SQLiteQuery pQuery) {
return new SQLiteCursor(pDb, pMasterQuery, pEditTable, pQuery) {
@Override
public boolean requery() {
setSelectionArguments(new String[] {"2"});
return super.requery();
}
};
}
示例5: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query) {
if (FSDBHelper.inst().inDebugMode()) {
Log.d("forsuredb", "Running query: " + masterQuery.toString());
}
return new FSCursor(new SQLiteCursor(masterQuery, editTable, query));
}
示例6: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query) {
/**
* {@link SQLiteDatabase} and {@link android.database.sqlite.SQLiteDirectCursorDriver}
*/
return new AutoCloseCursor(new SQLiteCursor(masterQuery, editTable, query));
}
示例7: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase sqLiteDatabase, SQLiteCursorDriver sqLiteCursorDriver, String tableName, SQLiteQuery sqLiteQuery) {
if (isDebugEnabled) {
QuantumFluxLog.d(sqLiteQuery.toString());
}
return new SQLiteCursor(sqLiteCursorDriver, tableName, sqLiteQuery);
}
示例8: rawQuery
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor rawQuery(final SupportSQLiteQuery supportQuery) {
return rawQueryWithFactory(new SQLiteDatabase.CursorFactory() {
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery,
String editTable, SQLiteQuery query) {
supportQuery.bindTo(new FrameworkSQLiteProgram(query));
return new SQLiteCursor(masterQuery, editTable, query);
}
}, supportQuery.getSql(), EMPTY_STRING_ARRAY, null);
}
示例9: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public Cursor newCursor(SQLiteDatabase sqLiteDatabase,
SQLiteCursorDriver sqLiteCursorDriver,
String editTable,
SQLiteQuery sqLiteQuery) {
if(Joogar.isDebug()) {
Joogar.getInstance().getLogger().d(sqLiteQuery.toString());
}
return new SQLiteCursor(sqLiteDatabase, sqLiteCursorDriver, editTable, sqLiteQuery);
}
示例10: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase sqLiteDatabase, SQLiteCursorDriver sqLiteCursorDriver, String tableName, SQLiteQuery sqLiteQuery) {
if (debugEnabled) {
CPOrmLog.d(sqLiteQuery.toString());
}
return new SQLiteCursor(sqLiteCursorDriver, tableName, sqLiteQuery);
}
示例11: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public Cursor newCursor(SQLiteDatabase sqLiteDatabase,
SQLiteCursorDriver sqLiteCursorDriver,
String editTable,
SQLiteQuery sqLiteQuery) {
if (debugEnabled) {
Log.d("SQL Log", sqLiteQuery.toString());
}
return new SQLiteCursor(sqLiteDatabase, sqLiteCursorDriver, editTable, sqLiteQuery);
}
示例12: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query) {
if (models == null || !models.containsKey(editTable)) {
return new SQLiteCursor(db, masterQuery, editTable, query);
} else {
EncryptedModel model = models.get(editTable);
return new DecryptingCursor(db, masterQuery, editTable, query, model, getCipherPool());
}
}
示例13: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery,
String editTable, SQLiteQuery query) {
LOG.debug(query.toString());
// non-deprecated API is only available in API 11
return new SQLiteCursor(db, masterQuery, editTable, query);
}
示例14: newCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
@Override
public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery,
String editTable, SQLiteQuery query) {
if (debugQueries) {
Log.d("SQL", query.toString());
}
return new SQLiteCursor(db, masterQuery, editTable, query);
}
示例15: logCursor
import android.database.sqlite.SQLiteQuery; //导入依赖的package包/类
/**
* Log the query of the given cursor.
*/
private void logCursor(Cursor cursor, String[] selectionArgs) {
try {
Field queryField = SQLiteCursor.class.getDeclaredField("mQuery");
queryField.setAccessible(true);
SQLiteQuery sqliteQuery = (SQLiteQuery) queryField.get(cursor);
Log.v(TAG, sqliteQuery.toString() + ": " + Arrays.toString(selectionArgs));
} catch (Exception e) {
Log.v(TAG, e.getMessage(), e);
}
}