72 lines
1.5 KiB
Java
72 lines
1.5 KiB
Java
package ch.progetto152.entity;
|
|
|
|
import javax.persistence.*;
|
|
import java.util.Objects;
|
|
|
|
@Entity
|
|
@Table(name = "User", schema = "Progetto152", catalog = "")
|
|
public class User {
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
@Id
|
|
@Column(name = "id")
|
|
private int id;
|
|
@Basic
|
|
@Column(name = "name")
|
|
private String name;
|
|
@Basic
|
|
@Column(name = "username")
|
|
private String username;
|
|
@Basic
|
|
@Column(name = "password")
|
|
private String password;
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(int id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getUsername() {
|
|
return username;
|
|
}
|
|
|
|
public void setUsername(String username) {
|
|
this.username = username;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public void setPassword(String password) {
|
|
this.password = password;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
User that = (User) o;
|
|
return id == that.id && Objects.equals(name, that.name) && Objects.equals(username, that.username) && Objects.equals(password, that.password);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(id, name, username, password);
|
|
}
|
|
}
|