Instead of casting the results: results = (List<Country>) query.execute();
you'll need to copy the results into the array. Note that you never actually use this array: List<Country> results = new ArrayList<Country>(); To see what I mean try this: final List<Country> results = new ArrayList<Country>(); HTH Fred On Mon, Aug 10, 2009 at 12:33 PM, Pavel Byles <[email protected]> wrote: > Hi Fred. I do do that.Here's a code sample: > > List<Country> results = new ArrayList<Country>(); > try { > Query query = pm.newQuery(Country.class); > query.setOrdering("name asc"); > results = (List<Country>) query.execute(); > } catch (... ...) { > > } > return results; > > On Mon, Aug 10, 2009 at 1:06 PM, Fred Sauer <[email protected]> wrote: > >> Pavel, >> You still will need to copy the result set into a new collection, e.g. an >> ArrayList. >> >> Fred >> >> >> On Mon, Aug 10, 2009 at 6:54 AM, Pavel Byles <[email protected]>wrote: >> >>> Fred,I have tried transferring a JDO enhanced class from server to >>> client, to no avail. The error I get is the same as before: >>> "org.datanucleus.store.appengine.query.*StreamingQueryResult* cannot be >>> cast .... " >>> >>> >>> On Wed, Aug 5, 2009 at 3:43 PM, Fred Sauer <[email protected]> wrote: >>> >>>> Let me know how it goes with the latest plugin and GWT 1.7.0. >>>> Just to be clear, JDO enhanced classes still won't pass round trip, even >>>> if they are in detached state. For that you still need to transfer some >>>> sort >>>> of DTO between client and server. However, if you just want to take a JDO >>>> class and transfer it one way, you can sort of get that to work. >>>> >>>> Fred >>>> >>>> >>>> On Wed, Aug 5, 2009 at 12:26 PM, Pavel Byles <[email protected]>wrote: >>>> >>>>> Ok, >>>>> this is great news. I will try this w/o your workaround and hope for >>>>> the best. >>>>> >>>>> On Wed, Aug 5, 2009 at 12:21 PM, Fred Sauer <[email protected]> wrote: >>>>> >>>>>> Pavel, >>>>>> Some of the annoyances have been cleaned up. The latest plugin takes >>>>>> care of some of that. >>>>>> >>>>>> The biggest thing left is how to deal with detachable 'bytecode >>>>>> enhanced' classes so that they can be sent round trip >>>>>> server->client->server. This has been discussed at length on the GWT >>>>>> user + >>>>>> contributor forums. I think some good work is happening in this area to >>>>>> make >>>>>> life easier. >>>>>> >>>>>> Fred >>>>>> >>>>>> >>>>>> On Wed, Aug 5, 2009 at 8:54 AM, Pavel Byles <[email protected]>wrote: >>>>>> >>>>>>> Has there been any further word on the GWT bug that requires the >>>>>>> following workaround: >>>>>>> http://fredsa.allen-sauer.com/2009/04/1st-look-at-app-engine-using-jdo.html? >>>>>>> Has this been fixed in 1.7? >>>>>>> -- >>>>>>> -Pav >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Fred Sauer >>>>>> Developer Advocate >>>>>> Google Inc. 1600 Amphitheatre Parkway >>>>>> Mountain View, CA 94043 >>>>>> [email protected] >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> -Pav >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Fred Sauer >>>> Developer Advocate >>>> Google Inc. 1600 Amphitheatre Parkway >>>> Mountain View, CA 94043 >>>> [email protected] >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> -- >>> -Pav >>> >>> >>> >> >> >> -- >> Fred Sauer >> Developer Advocate >> Google Inc. 1600 Amphitheatre Parkway >> Mountain View, CA 94043 >> [email protected] >> >> >> >> >> >> > > > -- > -Pav > > > > -- Fred Sauer Developer Advocate Google Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043 [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
