source: src/main/java/com/example/rezevirajmasa/demo/model/PriceHistory.java

main
Last change on this file was e48199a, checked in by Aleksandar Panovski <apano77@…>, 5 weeks ago

Final version for DB

  • Property mode set to 100644
File size: 882 bytes
Line 
1package com.example.rezevirajmasa.demo.model;
2
3import jakarta.persistence.*;
4import lombok.Data;
5import java.math.BigDecimal;
6import java.time.LocalDateTime;
7
8@Entity
9@Table(name = "price_history")
10@Data
11public class PriceHistory {
12
13 @Id
14 @GeneratedValue(strategy = GenerationType.IDENTITY)
15 @Column(name = "price_history_id")
16 private Long priceHistoryID;
17
18 @ManyToOne
19 @JoinColumn(name = "menu_id", nullable = false)
20 private Menu menu;
21
22 @Column(name = "old_price", precision = 8, scale = 2, nullable = false)
23 private BigDecimal oldPrice;
24
25 @Column(name = "change_date", nullable = false)
26 private LocalDateTime changeDate;
27
28 public PriceHistory() {}
29
30 public PriceHistory(Menu menu, BigDecimal oldPrice, LocalDateTime changeDate) {
31 this.menu = menu;
32 this.oldPrice = oldPrice;
33 this.changeDate = changeDate;
34 }
35}
Note: See TracBrowser for help on using the repository browser.