I have an application in front end i use angular and back end i use Spring boot. In my front end i must upload a CSV file that insert data in tables. So i send data to the backend which save it. My problem: i have a class Individus with relation @OneToMany to others class like as comptes. So when i try to get All individus with this Rest service : http://localhost:8080/api/individus, i have a parsing json data error.
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.9.6.jar:2.9.6]
at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:145) ~[jackson-databind-2.9.6.jar:2.9.6]
at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107) ~[jackson-databind-2.9.6.jar:2.9.6]
at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25) ~[jackson-databind-2.9.6.jar:2.9.6]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727) ~[jackson-databind-2.9.6.jar:2.9.6]
Here is my class Individus:
@Entity
public class Individu implements Serializable {
@Id
private String nui;
private int civility;
private String lastName;
private String useName;
private String firstName;
@Temporal(TemporalType.DATE)
@JsonFormat(pattern="dd/MM/yyyy")
private Date birthDate;
private String birthPlace;
private String birthCountry;
private String birthCountryLib;
private String nationality;
@OneToMany(mappedBy="individu", fetch = FetchType.LAZY)
private Collection<Compte> comptes;
@OneToMany(mappedBy="individu", fetch = FetchType.LAZY)
private Collection<Adresse> adresses;
@OneToMany(mappedBy="individu", fetch = FetchType.LAZY)
private Collection<Contact> contacts;
@OneToMany(mappedBy="individu", fetch = FetchType.LAZY)
private Collection<Iban> ibans;ode here
Is some one have a solution for me?