File tree Expand file tree Collapse file tree
src/main/java/cat/udl/eps/softarch/demo/domain Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import jakarta .persistence .OneToOne ;
1616import lombok .EqualsAndHashCode ;
1717
18+ import lombok .ToString ;
19+
1820@ Entity
1921@ DiscriminatorValue ("CREATOR" )
20- @ EqualsAndHashCode (callSuper = true )
22+ @ EqualsAndHashCode (callSuper = true , exclude = "profile" )
23+ @ ToString (exclude = "profile" )
2124public class Creator extends User {
2225
2326 @ OneToOne (cascade = CascadeType .ALL , orphanRemoval = true )
Original file line number Diff line number Diff line change 66import lombok .Data ;
77import lombok .EqualsAndHashCode ;
88
9+ import java .util .Set ;
10+ import java .util .HashSet ;
11+
912import java .time .ZonedDateTime ;
1013
1114@ Entity
@@ -36,6 +39,10 @@ public class Portfolio extends UriEntity<Long> {
3639 @ JsonIdentityReference (alwaysAsId = true )
3740 private User owner ;
3841
42+ @ ManyToMany (fetch = FetchType .EAGER )
43+ @ JsonIdentityReference (alwaysAsId = true )
44+ private Set <User > allowedUsers = new HashSet <>();
45+
3946 @ PrePersist
4047 protected void onCreate () {
4148 ZonedDateTime now = ZonedDateTime .now ();
Original file line number Diff line number Diff line change 33import jakarta .persistence .*;
44import lombok .Data ;
55
6+ import lombok .EqualsAndHashCode ;
7+ import lombok .ToString ;
8+
69@ Entity
710@ Data
11+ @ EqualsAndHashCode (exclude = "creator" )
12+ @ ToString (exclude = "creator" )
813public class Profile {
914
1015 @ Id
You can’t perform that action at this time.
0 commit comments