Dont have a example on githup repo please ? Il 17/nov/2016 09:17, "Romain Manni-Bucau [via TomEE & OpenEJB]" < [email protected]> ha scritto:
> Hello Mauro > > Personally i try to ensure i eagerly featch these relationships with a > jpql > query when possible. If really not possible using a @Stateful bean with an > EXTENDED persistence context can help. > > Le 17 nov. 2016 07:46, "mauro2java2011" <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=4680562&i=0>> a écrit : > > > i am a user of tomee 1.7.2 plus .and 1.7.4 plus and 7.0.2 plus . > > > > I have tried to generate a crud web app. > > > > Into my domain model i have for example a entity Customer with > @OneToMany > > Collection<Order> collectionOrders. > > > > And a Entity Order with @ManyToOne Customer customer. > > > > I would use the default lazy fetch type for orderscollection into > Customer > > entity. > > > > > > From a view jsf page i show the list of customer inside a table > > > > When i click on the row , with ajax i set the selected customer into the > > viewScoped customerController . > > > > > > So into the customerController i call a EJBFacede and i reattach the > > custoemer to em and retrive > > the orderslist.. with : > > inside the EJB: > > > > > > public Customer reattachandLoadORdersCOllection(Customer > > customToReattach){ > > Customer attached=em.merge(customToReattach). > > > > Collcetion<Orders> collection= atrtached.getOrdersCollection(); > > > > collection.size(); > > customToReattach.setOrdersCOllection(collection): > > return customToReattach > > } > > i set the collection to to customer and i return it to controller. > > > > Into the controller i take the Customer returned from the ejb with > > ordersColletion and i set to field Customer selected. > > > > > > > > so i you ask please : > > On tomee or some github repo it is present a working solution from a > Tomee > > plus that uses OpenJPA and CDI and has AJAX elements where they need to > > access LAZY relationships.? > > > > OR that show how resolve the lazy loading > > > > I would understand like resolve the lazi loading with tomee openjpa > > > > tank you in advance. > > Mauro > > > > > > > > -- > > View this message in context: http://tomee-openejb.979440. > > n4.nabble.com/tomee-example-for-resolve-the-problem-of- > > lazy-load-tp4680561.html > > Sent from the TomEE Users mailing list archive at Nabble.com. > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://tomee-openejb.979440.n4.nabble.com/tomee-example- > for-resolve-the-problem-of-lazy-load-tp4680561p4680562.html > To unsubscribe from tomee example for resolve the problem of lazy load., click > here > <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4680561&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2ODA1NjF8LTExMTcxODc2MjU=> > . > NAML > <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-example-for-resolve-the-problem-of-lazy-load-tp4680561p4680563.html Sent from the TomEE Users mailing list archive at Nabble.com.
