Line | |
---|
1 | package com.example.model;
|
---|
2 |
|
---|
3 | import lombok.Data;
|
---|
4 |
|
---|
5 | import javax.persistence.*;
|
---|
6 | import java.util.List;
|
---|
7 |
|
---|
8 | @Data
|
---|
9 | @Entity
|
---|
10 | @Table(name = "produkti")
|
---|
11 | @Inheritance(strategy = InheritanceType.JOINED)
|
---|
12 | public class Product {
|
---|
13 | @Id
|
---|
14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
15 | @Column(name = "produkt_id")
|
---|
16 | Integer product_id;
|
---|
17 |
|
---|
18 | @Column(name = "ime")
|
---|
19 | String name;
|
---|
20 |
|
---|
21 | @ManyToMany(mappedBy = "productList")
|
---|
22 | List<Catering> cateringList;
|
---|
23 | public Product(Integer product_id, String name) {
|
---|
24 | this.product_id = product_id;
|
---|
25 | this.name = name;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public Product() {
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.