Last change
on this file was f7c05a1, checked in by Elena Shulevska <elena.shulevska@…>, 15 months ago |
initial commit of the source code on origin
|
-
Property mode
set to
100644
|
File size:
689 bytes
|
Rev | Line | |
---|
[f7c05a1] | 1 | package com.example.villadihovo.model.offers;
|
---|
| 2 |
|
---|
| 3 | import com.example.villadihovo.model.users.UserTable;
|
---|
| 4 | import jakarta.persistence.*;
|
---|
| 5 | import lombok.AllArgsConstructor;
|
---|
| 6 | import lombok.Data;
|
---|
| 7 | import lombok.NoArgsConstructor;
|
---|
| 8 |
|
---|
| 9 | @Data
|
---|
| 10 | @NoArgsConstructor
|
---|
| 11 | @AllArgsConstructor
|
---|
| 12 | @Entity
|
---|
| 13 | @IdClass(PreparedMealId.class)
|
---|
| 14 | @Table(name="prepared_meal")
|
---|
| 15 | public class PreparedMeal {
|
---|
| 16 |
|
---|
| 17 | @Id
|
---|
| 18 | @ManyToOne
|
---|
| 19 | @JoinColumn(name = "meal_id", nullable = false)
|
---|
| 20 | private Meal meal;
|
---|
| 21 |
|
---|
| 22 | @Id
|
---|
| 23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 24 | @Column(nullable = false)
|
---|
| 25 | private int prepared_meal_id;
|
---|
| 26 |
|
---|
| 27 | @ManyToOne
|
---|
| 28 | @JoinColumn(name = "user_id", nullable = false)
|
---|
| 29 | private UserTable user_id;
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.