Skip to content

Commit 21b2ff1

Browse files
Merge pull request #8 from GabrielTorelo/feat/gameListClass
feat/gameListClass - OK
2 parents 54a7a7b + 5da8610 commit 21b2ff1

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package com.gabriel_torelo.game_list.entities;
2+
3+
import jakarta.persistence.Entity;
4+
import jakarta.persistence.GeneratedValue;
5+
import jakarta.persistence.GenerationType;
6+
import jakarta.persistence.Id;
7+
import jakarta.persistence.Table;
8+
9+
@Entity
10+
@Table(name = "tb_game_list")
11+
public class GameList {
12+
13+
@Id
14+
@GeneratedValue(strategy = GenerationType.IDENTITY)
15+
private Long id;
16+
private String name;
17+
18+
public GameList() {
19+
}
20+
21+
public GameList(Long id, String name) {
22+
this.id = id;
23+
this.name = name;
24+
}
25+
26+
public Long getId() {
27+
return id;
28+
}
29+
30+
public void setId(Long id) {
31+
this.id = id;
32+
}
33+
34+
public String getName() {
35+
return name;
36+
}
37+
38+
public void setName(String name) {
39+
this.name = name;
40+
}
41+
42+
@Override
43+
public int hashCode() {
44+
final int prime = 31;
45+
int result = 1;
46+
result = prime * result + ((id == null) ? 0 : id.hashCode());
47+
return result;
48+
}
49+
50+
@Override
51+
public boolean equals(Object obj) {
52+
if (this == obj)
53+
return true;
54+
if (obj == null)
55+
return false;
56+
if (getClass() != obj.getClass())
57+
return false;
58+
GameList other = (GameList) obj;
59+
if (id == null) {
60+
if (other.id != null)
61+
return false;
62+
} else if (!id.equals(other.id))
63+
return false;
64+
return true;
65+
}
66+
}

0 commit comments

Comments
 (0)