-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathMovie.java
More file actions
34 lines (29 loc) · 934 Bytes
/
Movie.java
File metadata and controls
34 lines (29 loc) · 934 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
package com.bobocode.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* TODO: you're job is to implement mapping for JPA entity {@link Movie}
* - explicitly specify the table name
* - specify id
* - configure id as auto-increment column, choose an Identity generation strategy
* - explicitly specify each column name ("id", "name", "director", and "duration" accordingly)
* - specify not null constraint for fields {@link Movie#name} and {@link Movie#director}
*/
@NoArgsConstructor
@Getter
@Setter
@Entity
@Table(name = "movie")
public class Movie {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name", nullable = false)
private String name;
@Column(name = "director", nullable = false)
private String director;
@Column(name = "duration")
private Integer durationSeconds;
}