java - JPA ManyToMany relation infinite loop -
i have 2 entity objects ,whose fields are:
operation--> {id, name, applications}
application-->{id, name, operations}
as u can see, both of these objects can include each others list,
@manytomany(cascade={cascadetype.all},targetentity=operation.class) @lazycollection(lazycollectionoption.false) @notfound(action = notfoundaction.ignore) @jointable(schema="rbmcore", name="t_rbm_opscreens_ops_apps", joincolumns={@joincolumn(name="app_id", referencedcolumnname="id")}, inversejoincolumns={@joincolumn(name="op_id", referencedcolumnname="id")})
other
@manytomany(cascade={cascadetype.all},mappedby="operations",targetentity=application.class) @lazycollection(lazycollectionoption.false) @notfound(action = notfoundaction.ignore)
each of them has definition this(vice versa join column part). when gives exception
"sessions not exist or closed"
.
when make lazyinit false, enters infinite loop , not surprise.(spring says problem because of json conversion of object think still related jpa)
what can problem? ideas appreciated.
Comments
Post a Comment