Last change
on this file since a436340 was a436340, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 17 months ago |
Adding customer registration
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | package edu.gjoko.schedlr.entity;
|
---|
2 |
|
---|
3 | import com.fasterxml.jackson.annotation.JsonManagedReference;
|
---|
4 | import lombok.AllArgsConstructor;
|
---|
5 | import lombok.Getter;
|
---|
6 | import lombok.NoArgsConstructor;
|
---|
7 | import lombok.Setter;
|
---|
8 |
|
---|
9 | import javax.persistence.*;
|
---|
10 | import java.time.LocalDateTime;
|
---|
11 | import java.util.List;
|
---|
12 |
|
---|
13 | @Entity
|
---|
14 | @Table(name = "business")
|
---|
15 | @Getter
|
---|
16 | @Setter
|
---|
17 | @NoArgsConstructor
|
---|
18 | @AllArgsConstructor
|
---|
19 | public class Business {
|
---|
20 |
|
---|
21 | @Id
|
---|
22 | @GeneratedValue(strategy = GenerationType.SEQUENCE)
|
---|
23 | private Long id;
|
---|
24 |
|
---|
25 | @Column(name = "name")
|
---|
26 | private String name;
|
---|
27 |
|
---|
28 | @OneToOne
|
---|
29 | @JoinColumn(name = "business_type_id", referencedColumnName = "id")
|
---|
30 | private BusinessType businessType;
|
---|
31 |
|
---|
32 | @Column(name = "opening_time")
|
---|
33 | private LocalDateTime openingTime;
|
---|
34 |
|
---|
35 | @Column(name = "closing_time")
|
---|
36 | private LocalDateTime closingTime;
|
---|
37 |
|
---|
38 | @ManyToOne
|
---|
39 | @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false)
|
---|
40 | private Stakeholder owner;
|
---|
41 |
|
---|
42 | @OneToMany(mappedBy = "business")
|
---|
43 | @JsonManagedReference
|
---|
44 | private List<Service> services;
|
---|
45 |
|
---|
46 | @Column(name = "created")
|
---|
47 | private LocalDateTime created;
|
---|
48 |
|
---|
49 | @Column(name = "modified")
|
---|
50 | private LocalDateTime modified;
|
---|
51 |
|
---|
52 |
|
---|
53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.