-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUsuario.java
More file actions
33 lines (30 loc) · 860 Bytes
/
Copy pathUsuario.java
File metadata and controls
33 lines (30 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package application.model;
import application.record.UsuarioDTO;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "usuarios")
@Getter
@Setter
@NoArgsConstructor
public class Usuario {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(name = "nome_de_usuario", nullable = false, unique = true)
private String nomeDeUsuario;
@Column(nullable = false)
private String senha;
public Usuario(UsuarioDTO dto) {
this.id = dto.id();
this.nomeDeUsuario = dto.nomeDeUsuario();
this.senha = dto.senha();
}
}