File tree Expand file tree Collapse file tree
src/main/java/com/gabriel_torelo/game_list/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments