-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathMovie.java
More file actions
51 lines (39 loc) · 1000 Bytes
/
Movie.java
File metadata and controls
51 lines (39 loc) · 1000 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
42
43
44
45
46
47
48
49
50
51
package com.booleanuk.api.cinema.movies;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "movies")
public class Movie {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column
private String title;
@Column
private String rating;
@Column
private String description;
@Column
private int runtimeMins;
@Column(nullable = false)
private LocalDateTime createdAt;
@Column(nullable = false)
private LocalDateTime updatedAt;
public Movie(String title, String rating, String description, int runtimeMins) {
this.title = title;
this.rating = rating;
this.description = description;
this.runtimeMins = runtimeMins;
}
public Movie(int id) {
this.id = id;
}
}