source: src/main/java/com/example/moviezone/model/Ticket.java@ 90317ea

Last change on this file since 90317ea was 3242ef4, checked in by milamihajlovska <mila.mihajlovska01@…>, 22 months ago

ticket service save method

  • Property mode set to 100644
File size: 709 bytes
Line 
1package com.example.moviezone.model;
2
3import javax.persistence.*;
4import lombok.Getter;
5import lombok.Setter;
6import lombok.ToString;
7
8import java.math.BigInteger;
9import java.time.LocalDate;
10import java.time.LocalDateTime;
11
12@Entity
13@Getter
14@Setter
15@ToString
16@Table(name = "tickets")
17public class Ticket {
18
19 @Id
20 @GeneratedValue(strategy = GenerationType.IDENTITY)
21 int id_ticket;
22
23 long price;
24 LocalDate date_reserved;
25
26 @ManyToOne
27 @JoinColumn(name = "id_customer")
28 Customer customer;
29
30 public Ticket(long price, Customer customer) {
31 this.price = price;
32 this.customer = customer;
33 this.date_reserved=LocalDate.now();
34 }
35
36 public Ticket() {
37
38 }
39}
Note: See TracBrowser for help on using the repository browser.