Skip to content

Commit 4a5c3bb

Browse files
committed
transformando o enum de categoria em uma classe entidade
1 parent d9f0651 commit 4a5c3bb

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed
Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
package dev.emanoel.modulo02.model;
22

3-
public enum Categoria {
3+
import javax.persistence.*;
44

5-
CELURARES,
6-
INFORMATICA,
7-
LIVROS;
5+
@Entity
6+
@Table(name = "categorias")
7+
public class Categoria {
8+
9+
@Id
10+
@GeneratedValue(strategy = GenerationType.IDENTITY)
11+
private Long id;
12+
private String nome;
13+
14+
public Long getId() {
15+
return id;
16+
}
17+
18+
public void setId(Long id) {
19+
this.id = id;
20+
}
21+
22+
public String getNome() {
23+
return nome;
24+
}
25+
26+
public void setNome(String nome) {
27+
this.nome = nome;
28+
}
829
}

0 commit comments

Comments
 (0)