- Timestamp:
- 12/19/21 19:39:00 (3 years ago)
- Branches:
- master
- Children:
- bdd6491
- Parents:
- 1ad8e64
- Location:
- trip-planner/src/main/java/finki/diplomska/tripplanner/models
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner/src/main/java/finki/diplomska/tripplanner/models/Planner.java
r1ad8e64 r84d0fbb 1 1 package finki.diplomska.tripplanner.models; 2 2 3 import com.fasterxml.jackson.annotation.JsonIgnore; 3 4 import lombok.*; 4 import reactor.util.annotation.Nullable;5 5 6 6 import javax.persistence.*; … … 10 10 @Data 11 11 @Table(name = "planners") 12 @NoArgsConstructor13 12 @AllArgsConstructor 14 13 @Getter … … 34 33 private List<Location> locationList; 35 34 35 @ManyToOne(fetch = FetchType.EAGER) 36 private User user; 36 37 37 public Planner(String name, String description, List<Location> locationList){ 38 public Planner(){ 39 } 40 41 public Planner(String name, String description, List<Location> locationList, User user){ 38 42 this.name = name; 39 43 this.description = description; 40 44 this.locationList = locationList; 45 this.user = user; 41 46 } 42 47 -
trip-planner/src/main/java/finki/diplomska/tripplanner/models/User.java
r1ad8e64 r84d0fbb 11 11 import javax.validation.constraints.Email; 12 12 import javax.validation.constraints.NotBlank; 13 import java.util.ArrayList; 13 14 import java.util.Collection; 14 15 import java.util.Date; 16 import java.util.List; 15 17 16 18 @Entity … … 38 40 private Date update_At; 39 41 40 //OneToMany with Project 42 //OneToMany with Planners 43 @OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "user", orphanRemoval = true) 44 @JsonIgnore 45 private List<Planner> planners = new ArrayList<>(); 41 46 42 47 public User() { 43 48 } 44 49 50 public User(String username, String fullName, String password, String confirmPassword) { 51 this.username = username; 52 this.fullName = fullName; 53 this.password = password; 54 this.confirmPassword = confirmPassword; 55 } 45 56 46 57 @PrePersist -
trip-planner/src/main/java/finki/diplomska/tripplanner/models/dto/PlannerDto.java
r1ad8e64 r84d0fbb 9 9 private String name; 10 10 private String description; 11 private String user; 11 12 12 public PlannerDto(String name, String description ) {13 public PlannerDto(String name, String description, String user) { 13 14 this.name = name; 14 15 this.description = description; 16 this.user = user; 15 17 } 16 18 } -
trip-planner/src/main/java/finki/diplomska/tripplanner/models/dto/UserDto.java
r1ad8e64 r84d0fbb 20 20 private Date update_At; 21 21 22 public UserDto(String username, String fullName, String password, String confirmPassword , Date create_At, Date update_At) {22 public UserDto(String username, String fullName, String password, String confirmPassword) { 23 23 this.username = username; 24 24 this.fullName = fullName; 25 25 this.password = password; 26 26 this.confirmPassword = confirmPassword; 27 this.create_At = create_At; 28 this.update_At = update_At; 27 29 28 } 30 29 }
Note:
See TracChangeset
for help on using the changeset viewer.