Skip to content

Commit

Permalink
feat: find project by project done.
Browse files Browse the repository at this point in the history
  • Loading branch information
seyedali-dev committed Jun 15, 2024
1 parent 8d55f00 commit e3c06b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.seyed.ali.timeentryservice.model.domain;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
Expand Down Expand Up @@ -30,6 +31,7 @@ public class TimeEntry implements Serializable {
@OneToMany(mappedBy = "timeEntry", cascade = CascadeType.ALL)
@ToString.Exclude
@Builder.Default
@JsonManagedReference // this is the forward part of the relationship – the one that gets serialized normally
private List<TimeSegment> timeSegmentList = new ArrayList<>();

private String userId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.seyed.ali.timeentryservice.model.domain;

import com.fasterxml.jackson.annotation.JsonBackReference;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
Expand All @@ -26,6 +27,7 @@ public class TimeSegment implements Serializable {
private Duration duration;

@ManyToOne(cascade = CascadeType.ALL)
@JsonBackReference // this is the back part of the relationship – it will be omitted from serialization to avoid the infinite loop
private TimeEntry timeEntry;

}

0 comments on commit e3c06b1

Please sign in to comment.