当前位置: 首页>>代码示例>>Java>>正文


Java AndroidDatabaseResults.getRawCursor方法代码示例

本文整理汇总了Java中com.j256.ormlite.android.AndroidDatabaseResults.getRawCursor方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidDatabaseResults.getRawCursor方法的具体用法?Java AndroidDatabaseResults.getRawCursor怎么用?Java AndroidDatabaseResults.getRawCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.j256.ormlite.android.AndroidDatabaseResults的用法示例。


在下文中一共展示了AndroidDatabaseResults.getRawCursor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeSubjectCursor

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
/**
 * Creates a cursor to get the topics in the stream in
 *
 * @param stream  from which topics similar to {@param subject} are selected
 * @param subject Filter out subject containing this string
 */
private Cursor makeSubjectCursor(CharSequence stream, CharSequence subject)
        throws SQLException {
    if (subject == null) {
        subject = "";
    }
    if (stream == null) {
        stream = "";
    }

    AndroidDatabaseResults results = (AndroidDatabaseResults) app
            .getDao(Message.class)
            .queryRaw(
                    "SELECT DISTINCT "
                            + Message.SUBJECT_FIELD
                            + ", 1 AS _id FROM messages JOIN streams ON streams."
                            + Stream.ID_FIELD + " = messages."
                            + Message.STREAM_FIELD + " WHERE "
                            + Message.SUBJECT_FIELD
                            + " LIKE ? ESCAPE '\\' AND "
                            + Stream.NAME_FIELD + " = ? ORDER BY "
                            + Message.SUBJECT_FIELD + " COLLATE NOCASE",
                    DatabaseHelper.likeEscape(subject.toString()) + "%",
                    stream.toString()).closeableIterator().getRawResults();
    return results.getRawCursor();
}
 
开发者ID:zulip,项目名称:zulip-android,代码行数:32,代码来源:ZulipActivity.java

示例2: obtainCursor

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
private Cursor obtainCursor(PreparedQuery<Observation> query, Dao<Observation, Long> oDao) throws SQLException {
	Cursor c = null;
	CloseableIterator<Observation> iterator = oDao.iterator(query);

	// get the raw results which can be cast under Android
	AndroidDatabaseResults results = (AndroidDatabaseResults) iterator.getRawResults();
	c = results.getRawCursor();
	if (c.moveToLast()) {
		long oldestTime = c.getLong(c.getColumnIndex("last_modified"));
		Log.i(LOG_NAME, "last modified is: " + c.getLong(c.getColumnIndex("last_modified")));
		Log.i(LOG_NAME, "querying again in: " + (oldestTime - requeryTime)/60000 + " minutes");
		if (queryUpdateHandle != null) {
			queryUpdateHandle.cancel(true);
		}
		queryUpdateHandle = scheduler.schedule(new Runnable() {
			public void run() {
				updateFilter();
			}
		}, oldestTime - requeryTime, TimeUnit.MILLISECONDS);
		c.moveToFirst();
	}
	return c;
}
 
开发者ID:ngageoint,项目名称:mage-android,代码行数:24,代码来源:ObservationFeedFragment.java

示例3: obtainCursor

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
private Cursor obtainCursor(PreparedQuery<Location> query, Dao<Location, Long> lDao) throws SQLException {
    Cursor c = null;
    CloseableIterator<Location> iterator = lDao.iterator(query);

    // get the raw results which can be cast under Android
    AndroidDatabaseResults results = (AndroidDatabaseResults) iterator.getRawResults();
    c = results.getRawCursor();
    if (c.moveToLast()) {
        if (queryUpdateHandle != null) {
            queryUpdateHandle.cancel(true);
        }
        queryUpdateHandle = scheduler.schedule(new Runnable() {
            public void run() {
                updateTimeFilter(getTimeFilterId());
            }
        }, 30*1000, TimeUnit.MILLISECONDS);
        c.moveToFirst();
    }
    return c;
}
 
开发者ID:ngageoint,项目名称:mage-android,代码行数:21,代码来源:PeopleFeedFragment.java

示例4: getCursor

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
public Cursor getCursor(QueryBuilder<T, Integer> qb) throws SQLException {
    CloseableIterator<T> iterator = this.getDao().iterator(qb.prepare());
    try {
        AndroidDatabaseResults results = (AndroidDatabaseResults) iterator.getRawResults();
        return results.getRawCursor();
    } finally {
        iterator.closeQuietly();
    }
}
 
开发者ID:androidfu,项目名称:Now-Playing,代码行数:10,代码来源:LocalStorageHandler.java

示例5: cursorFromQueryBuilder

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
static Cursor cursorFromQueryBuilder(QueryBuilder queryBuilder, String[] projection, String selection, String[] selectionArgs, String sortOrder) throws SQLException {
    if (projection != null)
        queryBuilder.selectColumns(projection);
    if (selection != null)
        queryBuilder.where().raw(selection, OrmUtil.selectArgsFromStrings(selectionArgs));
    if (sortOrder != null)
        queryBuilder.orderBy(sortOrder, true);

    CloseableIterator iterator = queryBuilder.iterator();
    AndroidDatabaseResults results = (AndroidDatabaseResults) iterator.getRawResults();
    return results.getRawCursor();
}
 
开发者ID:elliottsj,项目名称:ftw-android,代码行数:13,代码来源:OrmUtil.java

示例6: reload

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
public void reload(){
    if(itMangas != null){
        itMangas.closeQuietly();
    }

    try{
        itMangas = databaseHelper.getMangaRunDao().iterator(mangaQuery);
        mMangas = (AndroidDatabaseResults) itMangas.getRawResults();
        mAlphabetIndexer = new AlphabetIndexer(mMangas.getRawCursor(),
            mMangas.findColumn(Manga.TITLE_COLUMN_NAME), sections);
    } catch (SQLException e){
        e.printStackTrace();
    }
}
 
开发者ID:Vrael,项目名称:eManga,代码行数:15,代码来源:MangaItemListAdapter.java

示例7: getCursor

import com.j256.ormlite.android.AndroidDatabaseResults; //导入方法依赖的package包/类
private Cursor getCursor(QueryBuilder<Card, Long> queryBuilder) throws SQLException {
    CloseableIterator<Card> iterator = cardDao.iterator(queryBuilder.prepare());
    AndroidDatabaseResults results = (AndroidDatabaseResults) iterator.getRawResults();
    return results.getRawCursor();
}
 
开发者ID:wakhub,项目名称:monodict,代码行数:6,代码来源:DatabaseHelper.java


注:本文中的com.j256.ormlite.android.AndroidDatabaseResults.getRawCursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。