enter code hereHi Guys me and some classmates are working on a project for school and are stuck with this error: a cycle is detected in the object graph this will cause infinitely deep xml.
This is our code
@Entity
public class Client extends User implements Serializable {
@Temporal(javax.persistence.TemporalType.DATE)
private Date birthdate;
private String address;
private String zipcode;
private String city;
private String phone;
private String info;
private boolean active;
@OneToMany(mappedBy = "client")
private List<Cartrack> cartrac
And this is our cartrack object:
@Entity
public class Cartrack implements Serializable {
@Id
private String id;
@OneToOne( mappedBy = "cartrack",
cascade = CascadeType.ALL,
fetch = FetchType.EAGER
)
private Vehicle vehicle;
@ManyToOne
private Client client;
And last but not least the vehicle object:
@Entity
public class Vehicle implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String licenseNr;
private boolean stolen;
@OneToOne
private Cartrack cartrack;
All object have their setters and getters, and still after hours of research and reading tons of documentation we're still unable to fix the problem.
Our last hope is Stackoverflow!
Thanks in advance!