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


Java Query类代码示例

本文整理汇总了Java中android.arch.persistence.room.Query的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: findLoansByNameAfter

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT Loan.id, Book.title as title, User.name as name, Loan.startTime, Loan.endTime " +
        "FROM Book " +
        "INNER JOIN Loan ON Loan.book_id = Book.id " +
        "INNER JOIN User on User.id = Loan.user_id " +
        "WHERE User.name LIKE :userName " +
        "AND Loan.endTime > :after "
)
LiveData<List<LoanWithUserAndBook>> findLoansByNameAfter(String userName, Date after);
 
开发者ID:googlecodelabs,项目名称:android-persistence,代码行数:9,代码来源:LoanDao.java

示例2: join

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("select PhysicalCategory.id, PhysicalCategory.categoryName, PhysicalCategory.intensity, PhysicalCategory.isFavorite, CategoryData.duration " +
        "from PhysicalCategory " +
        "left join (select PhysicalEntry.duration, PhysicalEntry.categoryId " +
        "from PhysicalEntry where PhysicalEntry.date = " +
        "(select currentViewDate from ParamRecord limit 1)) " +
        "as CategoryData " +
        "on PhysicalCategory.id = CategoryData.categoryId ")
LiveData<List<PhysicalData>> getToday();
 
开发者ID:strudelauxpommes,项目名称:FitnessHabits,代码行数:9,代码来源:PhysicalDataDAO.java

示例3: getAll

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM station")
List<Station> getAll();
 
开发者ID:albertogiunta,项目名称:justintrain-client-android,代码行数:3,代码来源:StationDaoRoom.java

示例4: getAllByNameFancy

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM station WHERE name_fancy LIKE :nameFancy OR name_fancy LIKE :nameFancy2")
List<Station> getAllByNameFancy(String nameFancy, String nameFancy2);
 
开发者ID:albertogiunta,项目名称:justintrain-client-android,代码行数:3,代码来源:StationDaoRoom.java

示例5: selectAll

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM user")
List<User> selectAll();
 
开发者ID:jingle1267,项目名称:AndroidArchitectureComponets,代码行数:3,代码来源:UserDao.java

示例6: delete

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("DELETE FROM User")
void delete();
 
开发者ID:zmeiko,项目名称:LoriApp,代码行数:3,代码来源:UserDao.java

示例7: getAllArticlesByOldToNew

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("select * from Article ORDER BY TIMESTAMP ASC")
public Flowable<List<Article>> getAllArticlesByOldToNew();
 
开发者ID:ik024,项目名称:Inshorts,代码行数:3,代码来源:ArticleDao.java

示例8: getDocumentMetadata

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT " + COLUMN_ID + ", " +COLUMN_NAME + ", " + COLUMN_WORKING_TIME +
        ", " + COLUMN_LAST_EDITION_TIME + ", " + COLUMN_WORDS + ", " + COLUMN_FAVORITE +
        ", " + COLUMN_COVER_COLOR +  ", " + COLUMN_COVER_IMAGE + " FROM " + TABLE_NAME +
        " WHERE " + COLUMN_ID + " = :docId")
DocumentMetadata getDocumentMetadata(long docId);
 
开发者ID:nfdz,项目名称:foco,代码行数:6,代码来源:DocumentDao.java

示例9: getAll

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT account_name FROM eos_account WHERE account_name like :nameStarts ORDER BY account_name")
List<String> getAll(String nameStarts);
 
开发者ID:mithrilcoin-io,项目名称:EosCommander,代码行数:3,代码来源:EosAccountDao.java

示例10: loadAllPastFloors

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + VisitedFloor.TABLE)
List<VisitedFloor> loadAllPastFloors();
 
开发者ID:willowtreeapps,项目名称:elevator-room,代码行数:3,代码来源:FloorDao.java

示例11: deleteAll

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("DELETE FROM word_table")
void deleteAll();
 
开发者ID:googlecodelabs,项目名称:android-room-with-a-view,代码行数:3,代码来源:WordDao.java

示例12: getAll

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM feedEntrys")
LiveData<List<FeedEntry>> getAll();
 
开发者ID:charlesng,项目名称:SampleAppArch,代码行数:3,代码来源:FeedEntryDAO.java

示例13: findByUid

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM feedEntrys WHERE uid = :uid LIMIT 1")
LiveData<FeedEntry> findByUid(int uid);
 
开发者ID:charlesng,项目名称:SampleAppArch,代码行数:3,代码来源:FeedEntryDAO.java

示例14: findByText

import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM TimeEntry WHERE description LIKE'%'||:text||'%'")
List<TimeEntry> findByText(String text);
 
开发者ID:zmeiko,项目名称:LoriApp,代码行数:3,代码来源:TimeEntryDao.java

示例15: loadContributors

import android.arch.persistence.room.Query; //导入依赖的package包/类
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)
@Query("SELECT login, avatarUrl,repoName, repoOwner, contributions FROM contributor "
    + "WHERE repoName = :name AND repoOwner = :owner "
    + "ORDER BY contributions DESC")
public abstract LiveData<List<Contributor>> loadContributors(String owner, String name);
 
开发者ID:charlesng,项目名称:SampleAppArch,代码行数:6,代码来源:RepoDao.java


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