Tell me how you can transfer json from the front in spring MVC controller: class:
@Entity @Table(name = "PERSONS") public class Persons implements Serializable { @Id @Column(name = "PERSON_ID") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PERSONS_SEQ") @SequenceGenerator(name = "PERSONS_SEQ", sequenceName = "PERSONS_SEQ") private Integer personId; @Column(name = "NICKNAME", nullable = false, length = 30, unique = true) private String nickname; @Column(name = "PASSWORD", nullable = false, length = 100) private String password; @Column(name = "FIRST_NAME", nullable = false, length = 30) private String firstName; @Column(name = "LAST_NAME", nullable = false, length = 30) private String lastName; @ManyToOne(optional = false) @JsonManagedReference(value="person-city") @JoinColumn(name = "CITY_ID") private Cities city; @Column(name = "MOBILE_NUMBER", nullable = true, length = 30) private String mobileNumber; @Column(name = "EMAIL", nullable = false, length = 30) private String email; @OneToOne @JoinColumn(name = "ROLE_ID") private Rollers role; @OneToMany(mappedBy = "person", cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JsonManagedReference(value="person-cards") public List<Cards> cards = new ArrayList<Cards>(); public Persons() { } ... //all getters and setters } I believe that json is not properly formed. And this raises the question of how to transfer json, so that you don’t write its custom version at the front for sending it to the back.
