fix: Circular inclusion

pull/1/head
Lunix-420 2024-11-08 14:58:29 +01:00
parent 10b2b6d161
commit 0706bd294a
2 changed files with 3 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package com.maradona.backend.entities;
import jakarta.persistence.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import java.time.LocalTime;
import java.util.List;
import java.util.Map;
@ -10,7 +11,6 @@ import java.util.stream.Collectors;
@Entity
@Data
public class Employee {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ -31,6 +31,7 @@ public class Employee {
private LocalTime dEnd;
@OneToMany(mappedBy = "employee", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonManagedReference
private List<EmployeeSecondarySkill> secondarySkills;
public void setEmployeeNr(Integer employeeNr) {

View File

@ -1,13 +1,12 @@
package com.maradona.backend.entities;
import jakarta.persistence.*;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonBackReference;
@Entity
@Data
public class EmployeeSecondarySkill {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ -19,7 +18,6 @@ public class EmployeeSecondarySkill {
@ManyToOne
@JoinColumn(name = "secondary_skill_id", nullable = false)
@JsonBackReference
private SecondarySkill secondarySkill;
@Column(nullable = false)