-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBook.java
More file actions
41 lines (32 loc) · 903 Bytes
/
Book.java
File metadata and controls
41 lines (32 loc) · 903 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
41
package io.bcn.springConference.model;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;
import java.util.List;
import java.util.UUID;
@Entity
@Table(name = "books")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Book {
@Id
@GeneratedValue(generator = "UUID")
@GenericGenerator(name = "UUID",
strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "id", updatable = false,
nullable = false)
private UUID id;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String author;
@Column(name = "isbn", nullable = false, unique = true)
private String isbn;
@OneToMany(mappedBy = "book")
private List<Conference> conferences;
}