Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/java/cat/udl/eps/softarch/demo/domain/Creator.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
import jakarta.persistence.OneToOne;
import lombok.EqualsAndHashCode;

import lombok.ToString;

@Entity
@DiscriminatorValue("CREATOR")
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode(callSuper = true, exclude = "profile")
@ToString(exclude = "profile")
public class Creator extends User {

@OneToOne(cascade = CascadeType.ALL, orphanRemoval = true)
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Portfolio.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Set;
import java.util.HashSet;

import java.time.ZonedDateTime;

@Entity
Expand Down Expand Up @@ -36,6 +39,10 @@ public class Portfolio extends UriEntity<Long> {
@JsonIdentityReference(alwaysAsId = true)
private User owner;

@ManyToMany(fetch = FetchType.EAGER)
@JsonIdentityReference(alwaysAsId = true)
private Set<User> allowedUsers = new HashSet<>();

@PrePersist
protected void onCreate() {
ZonedDateTime now = ZonedDateTime.now();
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
import jakarta.persistence.*;
import lombok.Data;

import lombok.EqualsAndHashCode;
import lombok.ToString;

@Entity
@Data
@EqualsAndHashCode(exclude = "creator")
@ToString(exclude = "creator")
public class Profile {

@Id
Expand Down