main
Last change
on this file since c3278ac was fdd7961, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago |
fix many to one relations
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[3d3e59d] | 1 | package finki.paw5.model.entities;
|
---|
[d427a07] | 2 |
|
---|
[038c9f7] | 3 | import jakarta.persistence.*;
|
---|
[d427a07] | 4 | import lombok.Data;
|
---|
[fdd7961] | 5 | import lombok.RequiredArgsConstructor;
|
---|
[d427a07] | 6 |
|
---|
| 7 | @Data
|
---|
| 8 | @Entity
|
---|
[fdd7961] | 9 | @RequiredArgsConstructor
|
---|
[d427a07] | 10 | @Table(name = "shelter")
|
---|
| 11 | public class Shelter {
|
---|
| 12 |
|
---|
| 13 | @Id
|
---|
[038c9f7] | 14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
[d427a07] | 15 | @Column(name = "id_shelter")
|
---|
[ada7108] | 16 | private Integer id;
|
---|
[d427a07] | 17 |
|
---|
| 18 | @Column(name = "address_shelter", nullable = false, length = 100)
|
---|
| 19 | private String address;
|
---|
| 20 |
|
---|
| 21 | @Column(name = "telephone_shelter", nullable = false, length = 20)
|
---|
| 22 | private String telephone;
|
---|
| 23 |
|
---|
[fdd7961] | 24 | @ManyToOne
|
---|
| 25 | @JoinColumn(name = "id_organisation")
|
---|
| 26 | private Organisation organisation;
|
---|
[d427a07] | 27 |
|
---|
| 28 | @Column(name = "name_shelter", nullable = false, length = 100)
|
---|
| 29 | private String name;
|
---|
| 30 |
|
---|
| 31 | @Column(name = "email_shelter", nullable = false, length = 100, unique = true)
|
---|
| 32 | private String email;
|
---|
| 33 |
|
---|
[fdd7961] | 34 | public Shelter(String address, String telephone, Organisation organisation,
|
---|
| 35 | String name, String email) {
|
---|
[d427a07] | 36 | this.address = address;
|
---|
| 37 | this.telephone = telephone;
|
---|
[fdd7961] | 38 | this.organisation = organisation;
|
---|
[d427a07] | 39 | this.name = name;
|
---|
| 40 | this.email = email;
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.