This repository has been archived on 2020-06-04. You can view files and clone it, but cannot push or open issues or pull requests.
GitNex/app/src/main/java/org/mian/gitnex/database/models/Drafts.java
M M Arif 08b3e8c49f
All checks were successful
continuous-integration/drone/pr Build is passing
Add account to db and other refactors to the code
2020-04-20 00:17:14 +05:00

83 lines
1.8 KiB
Java

package org.mian.gitnex.database.models;
import androidx.annotation.Nullable;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import java.io.Serializable;
import static androidx.room.ForeignKey.CASCADE;
/**
* Author M M Arif
*/
@Entity(tableName = "Drafts", foreignKeys = @ForeignKey(entity = Repositories.class,
parentColumns = "repositoryId",
childColumns = "draftRepositoryId",
onDelete = CASCADE),
indices = {@Index("draftRepositoryId")})
public class Drafts implements Serializable {
@PrimaryKey(autoGenerate = true)
private int draftId;
private int draftRepositoryId;
private int draftAccountId;
private int issueId;
private String draftText;
@Nullable
private String draftType;
public int getDraftId() {
return draftId;
}
public void setDraftId(int draftId) {
this.draftId = draftId;
}
public int getDraftRepositoryId() {
return draftRepositoryId;
}
public void setDraftRepositoryId(int draftRepositoryId) {
this.draftRepositoryId = draftRepositoryId;
}
public int getDraftAccountId() {
return draftAccountId;
}
public void setDraftAccountId(int draftAccountId) {
this.draftAccountId = draftAccountId;
}
public int getIssueId() {
return issueId;
}
public void setIssueId(int issueId) {
this.issueId = issueId;
}
public String getDraftText() {
return draftText;
}
public void setDraftText(String draftText) {
this.draftText = draftText;
}
@Nullable
public String getDraftType() {
return draftType;
}
public void setDraftType(@Nullable String draftType) {
this.draftType = draftType;
}
}