android.arch.persistence.room.Index.<init>()方法的使用及代码示例

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

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

Index.<init>介绍

暂无

代码示例

代码示例来源: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: 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: 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;
 }
}

代码示例来源: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;
 }
}

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

@Entity(
    tableName = "DisabledPackage",
    indices = {@Index(value = {"packageName", "policyPackageId"}, unique = true)},
    foreignKeys = @ForeignKey(entity = PolicyPackage.class,
        parentColumns = "id",
        childColumns = "policyPackageId")
)
public class DisabledPackage {

  @PrimaryKey(autoGenerate = true)
  @ColumnInfo(name = "id")
  public long id;

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

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

}

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

@Entity(
    tableName = "FirewallWhitelistedPackage",
    indices = {@Index(value = {"packageName", "policyPackageId"}, unique = true)},
    foreignKeys = @ForeignKey(entity = PolicyPackage.class,
        parentColumns = "id",
        childColumns = "policyPackageId")
)
public class FirewallWhitelistedPackage {

  @PrimaryKey(autoGenerate = true)
  @ColumnInfo(name = "id")
  public long id;

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

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

  public FirewallWhitelistedPackage() {
  }

  @Ignore
  public FirewallWhitelistedPackage(String packageName, String policyPackageId) {
    this.packageName = packageName;
    this.policyPackageId = policyPackageId;
  }

}

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

@Entity(
    tableName = "BlockUrl",
    foreignKeys = @ForeignKey(
        entity = BlockUrlProvider.class,
        parentColumns = "_id",
        childColumns = "urlProviderId",
        onDelete = ForeignKey.CASCADE
    ),
    indices = {@Index(value = {"url", "urlProviderId"}, unique = true)}
)
public class BlockUrl {
  @PrimaryKey(autoGenerate = true)
  @ColumnInfo(name = "_id")
  public long id;

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

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

  public BlockUrl(String url, long urlProviderId) {
    this.url = url;
    this.urlProviderId = urlProviderId;
  }
}

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

@Entity(
    tableName = "WhiteUrl",
    indices = {@Index(value = {"url"}, unique = true)},
    foreignKeys = @ForeignKey(entity = PolicyPackage.class,
        parentColumns = "id",

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

@Entity(
    tableName = "UserBlockUrl",
    indices = {@Index(value = {"url"}, unique = true)},
    foreignKeys = @ForeignKey(entity = PolicyPackage.class,
        parentColumns = "id",

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

@Entity(tableName = "BlockUrlProviders",
    indices = {@Index(value = {"url"}, unique = true)},
    foreignKeys = @ForeignKey(entity = PolicyPackage.class,
        parentColumns = "id",
        childColumns = "policyPackageId"))
@TypeConverters(DateConverter.class)
public class BlockUrlProvider {
  @PrimaryKey(autoGenerate = true)
  @ColumnInfo(name = "_id")
  public long id;

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

  @ColumnInfo(name = "count")
  public int count;

  @ColumnInfo(name = "lastUpdated")
  public Date lastUpdated;

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

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

  @ColumnInfo(name = "policyPackageId")
  public String policyPackageId;
}

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

@Entity(
    tableName = "AppPermission",
    indices = {@Index(value = {"packageName", "permissionName", "policyPackageId"}, unique = true)},
    foreignKeys = @ForeignKey(entity = PolicyPackage.class,
        parentColumns = "id",

相关文章

微信公众号

最新文章

更多

Index类方法