source: src/main/java/com/example/moviezone/model/Ticket.java@ 04153a9

Last change on this file since 04153a9 was 00fa72f, checked in by DenicaKj <dkorvezir@…>, 21 months ago

Reservation Implemented

  • Property mode set to 100644
File size: 1.5 KB
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 @ManyToOne
30 @JoinColumn(name = "id_projection")
31 Projection projection;
32 @ManyToOne
33 @JoinColumn(name = "id_discount")
34 Discount discount;
35 @ManyToOne
36 @JoinColumn(name = "id_seat")
37 Seat seat;
38
39 public Ticket(long price, Customer customer) {
40 this.price = price;
41 this.customer = customer;
42 this.date_reserved=LocalDate.now();
43 }
44
45 public Ticket(LocalDate date_reserved, Customer customer, Projection projection, Seat seat) {
46 this.date_reserved = date_reserved;
47 this.customer = customer;
48 this.projection = projection;
49 this.seat = seat;
50 }
51
52 public Ticket( LocalDate date_reserved, Customer customer, Projection projection, Discount discount, Seat seat) {
53 this.date_reserved = date_reserved;
54 this.customer = customer;
55 this.projection = projection;
56 this.discount = discount;
57 this.seat = seat;
58 }
59
60 public Ticket() {
61
62 }
63
64 public void setPrice(long price) {
65 this.price = price;
66 }
67}
Note: See TracBrowser for help on using the repository browser.