Changeset 0e62f4d for springapp/src/main/java/mk/profesori
- Timestamp:
- 07/27/22 22:28:59 (2 years ago)
- Branches:
- main
- Children:
- 7cb8c3c
- Parents:
- b7ec74e
- Location:
- springapp/src/main/java/mk/profesori/springapp/Model
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java
rb7ec74e r0e62f4d 1 1 package mk.profesori.springapp.Model; 2 2 3 import java.util.ArrayList; 3 4 import java.util.Collection; 4 5 import java.util.Collections; 5 6 import java.util.HashSet; 7 import java.util.List; 6 8 import java.util.Set; 7 9 … … 19 21 import org.springframework.security.core.authority.SimpleGrantedAuthority; 20 22 import org.springframework.security.core.userdetails.UserDetails; 23 24 import com.fasterxml.jackson.annotation.JsonManagedReference; 21 25 22 26 import lombok.EqualsAndHashCode; … … 46 50 @OneToMany(mappedBy = "customUserDetails", cascade = CascadeType.ALL) 47 51 private Set<ConfirmationToken> confirmationTokens = new HashSet<>(); 52 @OneToMany(mappedBy = "author", cascade = CascadeType.ALL) 53 private List<Post> authoredPosts = new ArrayList<>(); 48 54 49 55 public CustomUserDetails(String fullName, String username, String email, String password, UserRole userRole) { … … 90 96 return enabled; 91 97 } 98 99 @JsonManagedReference 100 List<Post> getAuthoredPosts() { 101 return this.authoredPosts; 102 } 92 103 93 104 } -
springapp/src/main/java/mk/profesori/springapp/Model/Professor.java
rb7ec74e r0e62f4d 1 1 package mk.profesori.springapp.Model; 2 2 3 import java.util.ArrayList; 3 4 import java.util.HashSet; 5 import java.util.List; 4 6 import java.util.Set; 5 7 8 import javax.persistence.CascadeType; 6 9 import javax.persistence.Column; 7 10 import javax.persistence.Entity; … … 15 18 16 19 import com.fasterxml.jackson.annotation.JsonBackReference; 20 import com.fasterxml.jackson.annotation.JsonManagedReference; 17 21 18 22 @Entity … … 32 36 private Faculty faculty; 33 37 38 @OneToMany(mappedBy = "targetProfessor", cascade = CascadeType.ALL) 39 private List<Opinion> relatedOpinions = new ArrayList<Opinion>(); 40 34 41 //getters 35 42 public Long getProfessorId() { … … 45 52 return faculty; 46 53 } 54 55 @JsonManagedReference 56 public List<Opinion> getRelatedOpinions() { 57 return relatedOpinions; 58 } 47 59 } -
springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java
rb7ec74e r0e62f4d 12 12 import javax.persistence.ManyToOne; 13 13 import javax.persistence.OneToMany; 14 import javax.persistence.OneToOne; 14 15 import javax.persistence.Table; 15 16 … … 39 40 private Set<Subject> subjects = new HashSet<>(); 40 41 42 @OneToOne(mappedBy = "relatedStudyProgramme") 43 private Section relatedSection; 44 41 45 //getters 42 46 public Long getStudyProgrammeId() { … … 61 65 return subjects; 62 66 } 67 68 @JsonManagedReference 69 public Section getRelatedSection() { 70 return relatedSection; 71 } 63 72 } -
springapp/src/main/java/mk/profesori/springapp/Model/Subject.java
rb7ec74e r0e62f4d 1 1 package mk.profesori.springapp.Model; 2 2 3 import java.util.ArrayList; 3 4 import java.util.HashSet; 5 import java.util.List; 4 6 import java.util.Set; 5 7 8 import javax.persistence.CascadeType; 6 9 import javax.persistence.Column; 7 10 import javax.persistence.Entity; … … 15 18 16 19 import com.fasterxml.jackson.annotation.JsonBackReference; 20 import com.fasterxml.jackson.annotation.JsonManagedReference; 17 21 18 22 @Entity … … 32 36 private StudyProgramme studyProgramme; 33 37 38 @OneToMany(mappedBy = "targetSubject", cascade = CascadeType.ALL) 39 private List<_Thread> threads = new ArrayList<>(); 40 34 41 //getters 35 42 public Long getSubjectId() { … … 45 52 return studyProgramme; 46 53 } 54 55 @JsonManagedReference 56 public List<_Thread> getThreads() { 57 return threads; 58 } 47 59 48 60 }
Note:
See TracChangeset
for help on using the changeset viewer.