main
Last change
on this file since c049fd6 was c049fd6, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 13 months ago |
specify project schema in the backend
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package finki.paw5.model.entities;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.Data;
|
---|
5 | import lombok.RequiredArgsConstructor;
|
---|
6 |
|
---|
7 | import java.util.List;
|
---|
8 |
|
---|
9 | @Data
|
---|
10 | @Entity
|
---|
11 | @RequiredArgsConstructor
|
---|
12 | @Table(name = "organisation", schema = "project")
|
---|
13 | public class Organisation {
|
---|
14 |
|
---|
15 | @Id
|
---|
16 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
17 | @Column(name = "id_organisation")
|
---|
18 | private Integer id;
|
---|
19 |
|
---|
20 | @Column(name = "name_organisation", nullable = false, length = 100)
|
---|
21 | private String name;
|
---|
22 |
|
---|
23 | @Column(name = "email_organisation", nullable = false, length = 100, unique = true)
|
---|
24 | private String email;
|
---|
25 |
|
---|
26 | @Column(name = "billing_information", nullable = false, length = 20, unique = true)
|
---|
27 | private String billingInformation;
|
---|
28 |
|
---|
29 | @ManyToMany
|
---|
30 | @JoinTable(name = "donor_donates_to_organisation",
|
---|
31 | joinColumns = @JoinColumn(name = "id_organisation"),
|
---|
32 | inverseJoinColumns = @JoinColumn(name = "id_user"))
|
---|
33 | List<Donor> donors;
|
---|
34 |
|
---|
35 | public Organisation(String name, String email, String billingInformation) {
|
---|
36 | this.name = name;
|
---|
37 | this.email = email;
|
---|
38 | this.billingInformation = billingInformation;
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.