Java Code Examples for de.greenrobot.dao.query.Query#list()

The following examples show how to use de.greenrobot.dao.query.Query#list() . 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: ChallengeDao.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
/** Internal query to resolve the "challenges" to-many relationship of Category. */
public List<Challenge> _queryCategory_Challenges(long categoryId) {
    synchronized (this) {
        if (category_ChallengesQuery == null) {
            QueryBuilder<Challenge> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.CategoryId.eq(null));
            category_ChallengesQuery = queryBuilder.build();
        }
    }
    Query<Challenge> query = category_ChallengesQuery.forCurrentThread();
    query.setParameter(0, categoryId);
    return query.list();
}
 
Example 2
Source File: CompletionDao.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
/** Internal query to resolve the "completions" to-many relationship of User. */
public List<Completion> _queryUser_Completions(long userId) {
    synchronized (this) {
        if (user_CompletionsQuery == null) {
            QueryBuilder<Completion> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.UserId.eq(null));
            user_CompletionsQuery = queryBuilder.build();
        }
    }
    Query<Completion> query = user_CompletionsQuery.forCurrentThread();
    query.setParameter(0, userId);
    return query.list();
}
 
Example 3
Source File: StatisticsDao.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
/** Internal query to resolve the "statistics" to-many relationship of User. */
public List<Statistics> _queryUser_Statistics(long userId) {
    synchronized (this) {
        if (user_StatisticsQuery == null) {
            QueryBuilder<Statistics> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.UserId.eq(null));
            user_StatisticsQuery = queryBuilder.build();
        }
    }
    Query<Statistics> query = user_StatisticsQuery.forCurrentThread();
    query.setParameter(0, userId);
    return query.list();
}
 
Example 4
Source File: AnswerDao.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
/** Internal query to resolve the "answers" to-many relationship of Challenge. */
public List<Answer> _queryChallenge_Answers(long challengeId) {
    synchronized (this) {
        if (challenge_AnswersQuery == null) {
            QueryBuilder<Answer> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.ChallengeId.eq(null));
            challenge_AnswersQuery = queryBuilder.build();
        }
    }
    Query<Answer> query = challenge_AnswersQuery.forCurrentThread();
    query.setParameter(0, challengeId);
    return query.list();
}
 
Example 5
Source File: alloperatorsDao.java    From RxJavaApp with Apache License 2.0 5 votes vote down vote up
/** Internal query to resolve the "alloperatorsList" to-many relationship of operators. */
public List<alloperators> _queryOperators_AlloperatorsList(Long outer_id) {
    synchronized (this) {
        if (operators_AlloperatorsListQuery == null) {
            QueryBuilder<alloperators> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.Outer_id.eq(null));
            operators_AlloperatorsListQuery = queryBuilder.build();
        }
    }
    Query<alloperators> query = operators_AlloperatorsListQuery.forCurrentThread();
    query.setParameter(0, outer_id);
    return query.list();
}
 
Example 6
Source File: ContactDao.java    From AndroidDatabaseLibraryComparison with MIT License 5 votes vote down vote up
/** Internal query to resolve the "contactList" to-many relationship of AddressBook. */
public List<Contact> _queryAddressBook_ContactList(Long id) {
    synchronized (this) {
        if (addressBook_ContactListQuery == null) {
            QueryBuilder<Contact> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.Id.eq(null));
            addressBook_ContactListQuery = queryBuilder.build();
        }
    }
    Query<Contact> query = addressBook_ContactListQuery.forCurrentThread();
    query.setParameter(0, id);
    return query.list();
}
 
Example 7
Source File: AddressItemDao.java    From AndroidDatabaseLibraryComparison with MIT License 5 votes vote down vote up
/** Internal query to resolve the "addressItemList" to-many relationship of AddressBook. */
public List<AddressItem> _queryAddressBook_AddressItemList(Long id) {
    synchronized (this) {
        if (addressBook_AddressItemListQuery == null) {
            QueryBuilder<AddressItem> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.Id.eq(null));
            addressBook_AddressItemListQuery = queryBuilder.build();
        }
    }
    Query<AddressItem> query = addressBook_AddressItemListQuery.forCurrentThread();
    query.setParameter(0, id);
    return query.list();
}
 
Example 8
Source File: RxNews.java    From NBAPlus with Apache License 2.0 5 votes vote down vote up
private static News getCacheNews(String newsType) {
    News news=null;
    GreenNewsDao greenNewsDao = AppService.getDBHelper().getDaoSession().getGreenNewsDao();
    Query query = greenNewsDao.queryBuilder()
            .where(GreenNewsDao.Properties.Type.eq(newsType))
            .build();
    // 查询结果以 List 返回
    List<GreenNews> greenNewses = query.list();
    if(greenNewses!=null&&greenNewses.size()>0) {
        news = AppService.getGson().fromJson(greenNewses.get(0).getNewslist(), News.class);
    }
    return news;
}
 
Example 9
Source File: RxStats.java    From NBAPlus with Apache License 2.0 5 votes vote down vote up
private static Statistics getCacheStat(String statKind) {
    Statistics statistics=null;
    GreenStatDao greenStatDao = AppService.getDBHelper().getDaoSession().getGreenStatDao();
    Query query = greenStatDao.queryBuilder()
            .where(GreenStatDao.Properties.Statkind.eq(statKind))
            .build();
    // 查询结果以 List 返回
    List<GreenStat> greenStats = query.list();
    if(greenStats!=null&&greenStats.size()>0) {
        statistics = AppService.getGson().fromJson(greenStats.get(0).getStatentity(), Statistics.class);
    }
    return statistics;
}
 
Example 10
Source File: UserDao.java    From android-orm-benchmark with Apache License 2.0 5 votes vote down vote up
/** Internal query to resolve the "readers" to-many relationship of Message. */
public List<User> _queryMessage_Readers(Long id) {
    synchronized (this) {
        if (message_ReadersQuery == null) {
            QueryBuilder<User> queryBuilder = queryBuilder();
            queryBuilder.where(Properties.Id.eq(null));
            message_ReadersQuery = queryBuilder.build();
        }
    }
    Query<User> query = message_ReadersQuery.forCurrentThread();
    query.setParameter(0, id);
    return query.list();
}