Added identity linked account

This commit is contained in:
M66B
2018-08-08 10:22:12 +00:00
parent d844734627
commit a5af366b03
18 changed files with 882 additions and 70 deletions

View File

@@ -21,11 +21,19 @@ package eu.faircode.email;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import static androidx.room.ForeignKey.CASCADE;
@Entity(
tableName = EntityIdentity.TABLE_NAME,
foreignKeys = {
@ForeignKey(childColumns = "account", entity = EntityAccount.class, parentColumns = "id", onDelete = CASCADE)
},
indices = {
@Index(value = {"account"})
}
)
public class EntityIdentity {
@@ -39,6 +47,8 @@ public class EntityIdentity {
public String email;
public String replyto;
@NonNull
public Long account;
@NonNull
public String host; // SMTP
@NonNull
public Integer port;
@@ -60,6 +70,7 @@ public class EntityIdentity {
return (this.name.equals(other.name) &&
this.email.equals(other.email) &&
(this.replyto == null ? other.replyto == null : this.replyto.equals(other.replyto)) &&
this.account.equals(other.account) &&
this.host.equals(other.host) &&
this.port.equals(other.port) &&
this.starttls.equals(other.starttls) &&