-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenre.java
More file actions
40 lines (28 loc) · 840 Bytes
/
Genre.java
File metadata and controls
40 lines (28 loc) · 840 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
34
35
36
37
38
39
40
package com.example.accessingdatajpa;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Genre{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long GenreId;
private String GenreName;
protected Books() {}
public Genre(Long GenreId, String GenreName) {
this.GenreId = GenreId;
this.GenreName = GenreName;
@Override
public String toString() {
return String.format(
"Genre[GenreId=%d, GenreName='%s']",
GenreId, GenreName);
}
public Long GenreId() {
return GenreId;
}
public String getGenreName() {
return GenreName;
}
}