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

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

Reservation Implemented

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[e6b2246]1package com.example.moviezone.model;
2
[2269653]3import javax.persistence.*;
[e6b2246]4import lombok.Getter;
5import lombok.Setter;
6import lombok.ToString;
7
[2269653]8import java.math.BigInteger;
[eb226b2]9import java.time.LocalDate;
[e6b2246]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)
[2269653]21 int id_ticket;
[e6b2246]22
[2269653]23 long price;
[eb226b2]24 LocalDate date_reserved;
[e6b2246]25
26 @ManyToOne
[eb226b2]27 @JoinColumn(name = "id_customer")
[e6b2246]28 Customer customer;
[0ba5d1a]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;
[e6b2246]38
[3242ef4]39 public Ticket(long price, Customer customer) {
40 this.price = price;
41 this.customer = customer;
42 this.date_reserved=LocalDate.now();
43 }
[e6b2246]44
[00fa72f]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
[3242ef4]60 public Ticket() {
[e6b2246]61
[3242ef4]62 }
[00fa72f]63
64 public void setPrice(long price) {
65 this.price = price;
66 }
[e6b2246]67}
Note: See TracBrowser for help on using the repository browser.