json - How to serialise many to one relationship from the many side hibernate jpa -
i have many 1 relationship in hibernate models. there many people 1 role. have model "schools" 1 many join people model.
schools 1-* people *-1 role
i want , post schools model, should contain list of schools many people each 1 role. can not serialise roles people.
i need able serialise many 1 side (people-roles). when put @jsonmanagedreference on many 1 side, "404 validation error" trying post. when change jsonbackreference not serialised.
i have tried using @jsonidentityinfo, after googling try bidirectional relationship.
@jsonidentityinfo(generator = objectidgenerators.propertygenerator.class, property = "id") public class role { ... }
however when put in both models infinite recursion , tomcat times out.
how can implement this?
Comments
Post a Comment