Last change
on this file since 2c7a732 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 | |
---|
1 | package com.example.moviezone.model;
|
---|
2 |
|
---|
3 | import javax.persistence.*;
|
---|
4 | import lombok.Getter;
|
---|
5 | import lombok.Setter;
|
---|
6 | import lombok.ToString;
|
---|
7 |
|
---|
8 | import java.math.BigInteger;
|
---|
9 | import java.time.LocalDate;
|
---|
10 | import java.time.LocalDateTime;
|
---|
11 |
|
---|
12 | @Entity
|
---|
13 | @Getter
|
---|
14 | @Setter
|
---|
15 | @ToString
|
---|
16 | @Table(name = "tickets")
|
---|
17 | public 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.