當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。