84 lines
1.6 KiB
Java
84 lines
1.6 KiB
Java
package im.rosetta.database.entity;
|
|
|
|
import im.rosetta.database.CreateUpdateEntity;
|
|
|
|
import jakarta.persistence.Column;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.GeneratedValue;
|
|
import jakarta.persistence.GenerationType;
|
|
import jakarta.persistence.Id;
|
|
import jakarta.persistence.Index;
|
|
import jakarta.persistence.Table;
|
|
|
|
@Entity
|
|
@Table(name = "users", indexes = {
|
|
@Index(name = "idx_users_publickey", columnList = "publicKey", unique = true)
|
|
})
|
|
public class User extends CreateUpdateEntity {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@Column(name = "username")
|
|
private String username;
|
|
|
|
@Column(name = "title")
|
|
private String title;
|
|
|
|
@Column(name = "verified", nullable = false)
|
|
private int verified;
|
|
|
|
@Column(name = "privateKey", nullable = false)
|
|
private String privateKey;
|
|
|
|
@Column(name = "publicKey", nullable = false, unique = true)
|
|
private String publicKey;
|
|
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getPrivateKey() {
|
|
return privateKey;
|
|
}
|
|
|
|
public void setPrivateKey(String privateKey) {
|
|
this.privateKey = privateKey;
|
|
}
|
|
|
|
public String getUsername() {
|
|
return username;
|
|
}
|
|
|
|
public void setUsername(String username) {
|
|
this.username = username;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public String getPublicKey() {
|
|
return publicKey;
|
|
}
|
|
|
|
public void setPublicKey(String publicKey) {
|
|
this.publicKey = publicKey;
|
|
}
|
|
|
|
public int getVerified() {
|
|
return verified;
|
|
}
|
|
|
|
public void setVerified(int verified) {
|
|
this.verified = verified;
|
|
}
|
|
|
|
}
|