Best Approach for JPA lazy loading over Rest/AngularJS -
sorry general question, there approach still using jpa lazy loading of entities, when developing restful angularjs application.
in old jsf days, work when backing bean accessed list.
i using eclipselink , spring data, jersey restful end points.
regards
i
generally you'd have trigger lazy loading of entities prior entitymanager
being closed during lifecycle of request.
to so, can use "open entitymanager in view" pattern. spring provides filter
can apply: openentitymanagerinviewfilter
(read docs here: http://docs.spring.io/spring/docs/4.1.0.release/javadoc-api/org/springframework/orm/jpa/support/openentitymanagerinviewfilter.html).
alternatively, can manually call getmylazycollection()
on jpa entity(ies) prior serializing them json.
Comments
Post a Comment