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

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

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

Index介绍

暂无

代码示例

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

@Entity(tableName = PLAYLIST_STREAM_JOIN_TABLE,
    primaryKeys = {JOIN_PLAYLIST_ID, JOIN_INDEX},
    indices = {
        @Index(value = {JOIN_PLAYLIST_ID, JOIN_INDEX}, unique = true),
        @Index(value = {JOIN_STREAM_ID})
    },
    foreignKeys = {

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

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

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

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

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

@Entity(tableName = REMOTE_PLAYLIST_TABLE,
    indices = {
        @Index(value = {REMOTE_PLAYLIST_NAME}),
        @Index(value = {REMOTE_PLAYLIST_SERVICE_ID, REMOTE_PLAYLIST_URL}, unique = true)
    })
public class PlaylistRemoteEntity implements PlaylistLocalItem {

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

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

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

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

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

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

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

@Entity(indices = {@Index("id")},
    primaryKeys = {"id"})
public class Genre {

  @NonNull
  public int id;
  public String name;

  public Genre(int id, String name) {
    this.id = id;
    this.name = name;
  }

  @Override
  public String toString() {
    return "ClassPojo [id = " + id + ", name = " + name + "]";
  }
}

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

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

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

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

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

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

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

childColumns="tripId",
  onDelete=CASCADE),
 indices=@Index("tripId"))
public class Link implements Note {
 @PrimaryKey

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

@Entity(tableName="paragraphs",
 foreignKeys=@ForeignKey(entity=ChapterEntity.class, parentColumns="id",
  childColumns="chapterId", onDelete=ForeignKey.CASCADE),
 indices={@Index(value="chapterId")})
public class ParagraphEntity {
 @PrimaryKey
 long sequence;
 String prose;
 long chapterId;

 ParagraphEntity(String prose) {
  this.prose=prose;
 }
}

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

childColumns="tripId",
  onDelete=CASCADE),
 indices=@Index("tripId"))
public class Comment implements Note {
 @PrimaryKey

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

childColumns="tripId",
  onDelete=CASCADE),
 indices=@Index("tripId"))
public class Note {
 public enum Type {

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

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

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

childColumns="tripId",
  onDelete=CASCADE),
 indices=@Index("tripId"))
class Flight extends Plan {
 public final String departingAirport;

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

@Entity(tableName = "trophy",
    foreignKeys = {
        @ForeignKey(
            entity = User.class,
            parentColumns = "id",
            childColumns = "userId",
            onDelete = ForeignKey.CASCADE
        )},
    indices = { @Index(value = "userId")}
)
public class Trophy {

  @PrimaryKey(autoGenerate = true)
  long id;

  public long userId;

  String description;

  public Trophy(long userId, String description) {
    this.userId = userId;
    this.description = description;
  }
}

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

@Entity(
    tableName = "AppInfo",
    indices = {@Index("appName"), @Index("installTime"), @Index("disabled")}
)
@TypeConverters(DateConverter.class)
public class AppInfo {
  @PrimaryKey
  public long id;

  @ColumnInfo(name = "packageName")
  public String packageName;

  @ColumnInfo(name = "appName")
  public String appName;

  @ColumnInfo(name = "installTime")
  public long installTime;

  @ColumnInfo(name = "system")
  public boolean system;

  @ColumnInfo(name = "adhellWhitelisted")
  public boolean adhellWhitelisted;

  @ColumnInfo(name = "disabled")
  public boolean disabled;
}

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

@Entity(
 tableName="lodgings",
 foreignKeys=@ForeignKey(
  entity=Trip.class,
  parentColumns="id",
  childColumns="tripId",
  onDelete=CASCADE),
 indices=@Index("tripId"))
@TypeConverters({TypeTransmogrifier.class})
class Lodging extends Plan {
 public final String address;
 public final String tripId;

 @Ignore
 Lodging(String title, int duration, Priority priority, Date startTime,
     String address, String tripId) {
  super(title, duration, priority, startTime);
  this.address=address;
  this.tripId=tripId;
 }

 Lodging(String id, String title, int duration,
     Priority priority, Date startTime, Date creationTime,
     Date updateTime, String address, String tripId) {
  super(id, title, duration, priority, startTime, creationTime, updateTime);
  this.address=address;
  this.tripId=tripId;
 }
}

相关文章

微信公众号

最新文章

更多

Index类方法