Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Entity lazy loading strategy from remote client(Entity lazy loading strategy from remote client)
Entity lazy loading strategy from remote client [message #880560] Sat, 02 June 2012 09:31 Go to next message
Pal Konyves is currently offline Pal KonyvesFriend
Messages: 4
Registered: July 2011
Junior Member
Hi,

I'm developing a remote client with Eclipse RCP and Glassfish with EclipseLink on the server side.

Can anyone tell me about strategies to use when I need lazy loaded fields in an entity on the client side?

Let's see a use-case: when I want to show the user a list of somethinBean. SomethingBean has many lazy-loaded fields like collections which I don't show in the list, but when the user wants to change one list item, the fields need to be loaded over the network.

Are there any known strategies, patterns for this? In other forum I got the answer:
"Consider the domain objects, at client-side, exactly as you would consider DTOs or JSON objects: objects containing some incormation coming from the server and seralized over the wire." [...] " If you are on some "list" screen and want to see the detailed view of one of the elements of the list, for example, call another service which loads the entity again from the database"

Is this the right approach?

Thank you for your answers!
Re: Entity lazy loading strategy from remote client [message #881940 is a reply to message #880560] Tue, 05 June 2012 14:22 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

That is probably the best approach.

EclipseLink supports Load Groups on queries, that allows you to specify exactly which attributes you want instantiated. You can also use the copy() API to force the instantiation of an Attribute Group.

EclipseLink does have a RemoteSession feature from way back in the fat client CORBA/RMI days, before Java EE, JSPs, web services. It allows remote access, but it only supports the EclipseLink native API, not JPA, and although it is still tested, no new development has been done on it for quite some time. If fat clients start to make a big come back, maybe it would be worth adding JPA support to it.




James : Wiki : Book : Blog : Twitter
Re: Entity lazy loading strategy from remote client [message #886183 is a reply to message #881940] Thu, 14 June 2012 11:53 Go to previous message
Pal Konyves is currently offline Pal KonyvesFriend
Messages: 4
Registered: July 2011
Junior Member
Thank you, I will stick with this webservice-like approach. It has the advantages of well-defined server-client communication, which can be traced as calling my remote business methods and I don't rely on some communications behind the scene.
Previous Topic:Primary keys must not contain null
Next Topic:please help, errors with Map <Entity, Basic>
Goto Forum:
  


Current Time: Thu Mar 28 10:19:51 GMT 2024

Powered by FUDForum. Page generated in 0.05247 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top