source: trip-planner/src/main/java/finki/diplomska/tripplanner/models/Country.java

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 
1package finki.diplomska.tripplanner.models;
2
3import com.fasterxml.jackson.annotation.JsonManagedReference;
4import lombok.AllArgsConstructor;
5import lombok.Getter;
6import lombok.NoArgsConstructor;
7import lombok.Setter;
8
9import javax.persistence.*;
10import java.util.List;
11
12@Entity
13@Table(name = "countries")
14@NoArgsConstructor
15@AllArgsConstructor
16@Getter
17@Setter
18public 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.