Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
719 bytes
|
Line | |
---|
1 | package finki.diplomska.tripplanner.models;
|
---|
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.util.List;
|
---|
11 |
|
---|
12 | @Entity
|
---|
13 | @Table(name = "countries")
|
---|
14 | @NoArgsConstructor
|
---|
15 | @AllArgsConstructor
|
---|
16 | @Getter
|
---|
17 | @Setter
|
---|
18 | public class Country {
|
---|
19 |
|
---|
20 | @Id
|
---|
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
22 | @Column(name = "id_country")
|
---|
23 | private Long id;
|
---|
24 |
|
---|
25 | @Column(name = "country_name")
|
---|
26 | private String name;
|
---|
27 |
|
---|
28 | @OneToMany(mappedBy = "country", cascade = CascadeType.REMOVE, orphanRemoval = true)
|
---|
29 | @JsonManagedReference
|
---|
30 | private List<Region> regionList;
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.