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

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -