Monday, June 25, 2012

Re: Using EntityProxyId in a service call

Just to follow up,

I more or less did what you suggested.  In my situation, I was hoping to have my UI Views be oblivious as to whether they were showing "historical" data, and needed that revision timestamp, or showing "live" data where that timestamp was not needed (and "find" could be called as normal).

I was able to abstract my service calls, and override the EntityProxyChange event.  When in "historical" mode, I can cast the EntityProxyChange to my historical version, get the ID (long in this case) and make the modified "find" call to the service.  This let me plow straight ahead, without having to change the views.

Thanks!

--Rob

On Thursday, June 21, 2012 1:07:00 AM UTC-7, Thomas Broyer wrote:

On Thursday, June 21, 2012 1:20:28 AM UTC+2, Rob Whiteside wrote:
I am using RequestFactory to fetch data from the server and have came across a situation that I can't find an answer to:

On the client I have an EntityProxyId for a proxy that I want to fetch.  Normally, I'd just do a "find" and off it goes to the server.  Then, my Locator's "find" gets called, but now this EntityProxyId is actually the ID that I can use to grab it from the database.

But, in this particular case, I'm interested in finding a particular revision of that entity.  So, I'd like to include a date or timestamp in that "find" call (at this point, i'd be able to query the db to grab the correct revision of said entity).  I can't quite figure out how to do this... Is there a way that I can create a new service call that will still do that magic translation of the EntityProxyID into the actual database Id?  That way, I can still include that extra timestamp.

If you can, replace EntityProxyId with the ID of the entity (Long or String or whatever), that's the simplest and IMO cleanest way of doing what you want.

The only alternative is to help finish http://code.google.com/p/google-web-toolkit/issues/detail?id=5525 by providing a patch (looks like the only missing part is support in the GWT generator)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/L6wmQ1y2bRAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment