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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -