android.arch.persistence.room.Index类的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中android.arch.persistence.room.Index类的一些代码示例,展示了Index类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index类的具体详情如下:
包路径:android.arch.persistence.room.Index
类名称:Index

Index介绍

暂无

代码示例

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = PLAYLIST_STREAM_JOIN_TABLE,
  2. primaryKeys = {JOIN_PLAYLIST_ID, JOIN_INDEX},
  3. indices = {
  4. @Index(value = {JOIN_PLAYLIST_ID, JOIN_INDEX}, unique = true),
  5. @Index(value = {JOIN_STREAM_ID})
  6. },
  7. foreignKeys = {

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = STREAM_HISTORY_TABLE,
  2. primaryKeys = {JOIN_STREAM_ID, STREAM_ACCESS_DATE},
  3. indices = {@Index(value = {JOIN_STREAM_ID})},
  4. foreignKeys = {
  5. @ForeignKey(entity = StreamEntity.class,

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = PLAYLIST_TABLE,
  2. indices = {@Index(value = {PLAYLIST_NAME})})
  3. public class PlaylistEntity {
  4. final public static String PLAYLIST_TABLE = "playlists";

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = REMOTE_PLAYLIST_TABLE,
  2. indices = {
  3. @Index(value = {REMOTE_PLAYLIST_NAME}),
  4. @Index(value = {REMOTE_PLAYLIST_SERVICE_ID, REMOTE_PLAYLIST_URL}, unique = true)
  5. })
  6. public class PlaylistRemoteEntity implements PlaylistLocalItem {

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = SearchHistoryEntry.TABLE_NAME,
  2. indices = {@Index(value = SEARCH)})
  3. public class SearchHistoryEntry {

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = SUBSCRIPTION_TABLE,
  2. indices = {@Index(value = {SUBSCRIPTION_SERVICE_ID, SUBSCRIPTION_URL}, unique = true)})
  3. public class SubscriptionEntity {

代码示例来源:origin: TeamNewPipe/NewPipe

  1. @Entity(tableName = STREAM_TABLE,
  2. indices = {@Index(value = {STREAM_SERVICE_ID, STREAM_URL}, unique = true)})
  3. public class StreamEntity implements Serializable {

代码示例来源:origin: kioko/android-liveData-viewModel

  1. @Entity(indices = {@Index("id")},
  2. primaryKeys = {"id"})
  3. public class Genre {
  4. @NonNull
  5. public int id;
  6. public String name;
  7. public Genre(int id, String name) {
  8. this.id = id;
  9. this.name = name;
  10. }
  11. @Override
  12. public String toString() {
  13. return "ClassPojo [id = " + id + ", name = " + name + "]";
  14. }
  15. }

代码示例来源:origin: kioko/android-liveData-viewModel

  1. @Entity(indices = {@Index("id")},
  2. primaryKeys = {"id"})
  3. public class TmdbVideo {

代码示例来源:origin: kioko/android-liveData-viewModel

  1. @Entity(indices = {@Index("id")},
  2. primaryKeys = {"id"})
  3. @TypeConverters(TmdbTypeConverters.class)

代码示例来源:origin: commonsguy/cw-androidarch

  1. @Entity(tableName="todos", indices=@Index(value="id"))
  2. public class ToDoEntity {
  3. @PrimaryKey

代码示例来源:origin: commonsguy/cw-androidarch

  1. childColumns="tripId",
  2. onDelete=CASCADE),
  3. indices=@Index("tripId"))
  4. public class Link implements Note {
  5. @PrimaryKey

代码示例来源:origin: commonsguy/cw-androidarch

  1. @Entity(tableName="paragraphs",
  2. foreignKeys=@ForeignKey(entity=ChapterEntity.class, parentColumns="id",
  3. childColumns="chapterId", onDelete=ForeignKey.CASCADE),
  4. indices={@Index(value="chapterId")})
  5. public class ParagraphEntity {
  6. @PrimaryKey
  7. long sequence;
  8. String prose;
  9. long chapterId;
  10. ParagraphEntity(String prose) {
  11. this.prose=prose;
  12. }
  13. }

代码示例来源:origin: commonsguy/cw-androidarch

  1. childColumns="tripId",
  2. onDelete=CASCADE),
  3. indices=@Index("tripId"))
  4. public class Comment implements Note {
  5. @PrimaryKey

代码示例来源:origin: commonsguy/cw-androidarch

  1. childColumns="tripId",
  2. onDelete=CASCADE),
  3. indices=@Index("tripId"))
  4. public class Note {
  5. public enum Type {

代码示例来源:origin: jenly1314/WanAndroid

  1. @Entity(indices = {@Index(value = "name", unique = true)})
  2. public class SearchHistory {

代码示例来源:origin: commonsguy/cw-androidarch

  1. childColumns="tripId",
  2. onDelete=CASCADE),
  3. indices=@Index("tripId"))
  4. class Flight extends Plan {
  5. public final String departingAirport;

代码示例来源:origin: vogellacompany/codeexamples-android

  1. @Entity(tableName = "trophy",
  2. foreignKeys = {
  3. @ForeignKey(
  4. entity = User.class,
  5. parentColumns = "id",
  6. childColumns = "userId",
  7. onDelete = ForeignKey.CASCADE
  8. )},
  9. indices = { @Index(value = "userId")}
  10. )
  11. public class Trophy {
  12. @PrimaryKey(autoGenerate = true)
  13. long id;
  14. public long userId;
  15. String description;
  16. public Trophy(long userId, String description) {
  17. this.userId = userId;
  18. this.description = description;
  19. }
  20. }

代码示例来源:origin: GoldenKappa/notSABS

  1. @Entity(
  2. tableName = "AppInfo",
  3. indices = {@Index("appName"), @Index("installTime"), @Index("disabled")}
  4. )
  5. @TypeConverters(DateConverter.class)
  6. public class AppInfo {
  7. @PrimaryKey
  8. public long id;
  9. @ColumnInfo(name = "packageName")
  10. public String packageName;
  11. @ColumnInfo(name = "appName")
  12. public String appName;
  13. @ColumnInfo(name = "installTime")
  14. public long installTime;
  15. @ColumnInfo(name = "system")
  16. public boolean system;
  17. @ColumnInfo(name = "adhellWhitelisted")
  18. public boolean adhellWhitelisted;
  19. @ColumnInfo(name = "disabled")
  20. public boolean disabled;
  21. }

代码示例来源:origin: commonsguy/cw-androidarch

  1. @Entity(
  2. tableName="lodgings",
  3. foreignKeys=@ForeignKey(
  4. entity=Trip.class,
  5. parentColumns="id",
  6. childColumns="tripId",
  7. onDelete=CASCADE),
  8. indices=@Index("tripId"))
  9. @TypeConverters({TypeTransmogrifier.class})
  10. class Lodging extends Plan {
  11. public final String address;
  12. public final String tripId;
  13. @Ignore
  14. Lodging(String title, int duration, Priority priority, Date startTime,
  15. String address, String tripId) {
  16. super(title, duration, priority, startTime);
  17. this.address=address;
  18. this.tripId=tripId;
  19. }
  20. Lodging(String id, String title, int duration,
  21. Priority priority, Date startTime, Date creationTime,
  22. Date updateTime, String address, String tripId) {
  23. super(id, title, duration, priority, startTime, creationTime, updateTime);
  24. this.address=address;
  25. this.tripId=tripId;
  26. }
  27. }

相关文章

Index类方法