diff --git a/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java b/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java index cf0720cf..3e01199c 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java +++ b/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java @@ -1,18 +1,18 @@ package one.nem.lacerta.source.database.entity; +import androidx.annotation.NonNull; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.PrimaryKey; -@Entity(tableName = "toxi_document_tag") +@Entity(primaryKeys = {"document_id", "tag_id"}, tableName = "toxi_document_tag") public class ToxiDocumentTagEntity { - // 複合主キー - @PrimaryKey + @NonNull @ColumnInfo(name = "document_id") public String documentId; // ドキュメントID - @PrimaryKey + @NonNull @ColumnInfo(name = "tag_id") public String tagId; // タグID }