forked from Muriloabreu/controle-estoque
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0be28a
commit c032ba6
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
src/main/java/com/api/controleestoque/models/CategoriaModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package com.api.controleestoque.models; | ||
|
||
import java.util.Objects; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "TB_CATEGORIAS") | ||
public class CategoriaModel { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Long id; | ||
@Column(nullable = false) | ||
private String nome; | ||
@Column(nullable = false) | ||
private String descricao; | ||
|
||
/* Construtor */ | ||
|
||
public CategoriaModel() { | ||
super(); | ||
} | ||
|
||
public CategoriaModel(Long id, String nome, String descricao) { | ||
super(); | ||
this.id = id; | ||
this.nome = nome; | ||
this.descricao = descricao; | ||
} | ||
|
||
|
||
/* Métodos Acessores */ | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getNome() { | ||
return nome; | ||
} | ||
|
||
public void setNome(String nome) { | ||
this.nome = nome; | ||
} | ||
|
||
public String getDescricao() { | ||
return descricao; | ||
} | ||
|
||
public void setDescricao(String descricao) { | ||
this.descricao = descricao; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CategoriaModel [id=" + id + ", nome=" + nome + ", descricao=" + descricao + "]"; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(descricao, id, nome); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
CategoriaModel other = (CategoriaModel) obj; | ||
return Objects.equals(descricao, other.descricao) && Objects.equals(id, other.id) | ||
&& Objects.equals(nome, other.nome); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
} |