本文整理汇总了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);
示例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();
示例3: getAll
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM station")
List<Station> getAll();
示例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);
示例5: selectAll
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM user")
List<User> selectAll();
示例6: delete
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("DELETE FROM User")
void delete();
示例7: getAllArticlesByOldToNew
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("select * from Article ORDER BY TIMESTAMP ASC")
public Flowable<List<Article>> getAllArticlesByOldToNew();
示例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);
示例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);
示例10: loadAllPastFloors
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM " + VisitedFloor.TABLE)
List<VisitedFloor> loadAllPastFloors();
示例11: deleteAll
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("DELETE FROM word_table")
void deleteAll();
示例12: getAll
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM feedEntrys")
LiveData<List<FeedEntry>> getAll();
示例13: findByUid
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM feedEntrys WHERE uid = :uid LIMIT 1")
LiveData<FeedEntry> findByUid(int uid);
示例14: findByText
import android.arch.persistence.room.Query; //导入依赖的package包/类
@Query("SELECT * FROM TimeEntry WHERE description LIKE'%'||:text||'%'")
List<TimeEntry> findByText(String text);
示例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);