Hi Andy, > Why are you calling setResultClass() (legacy API) when using > executeResultList(resultClass) which tells it the result class ? [not > that this affects the result, but I don't get the mix of legacy with > generics APIs] > yes, calling setResultClass is not necessary for this test. I just called it to see whether it makes any difference with respect to the issue. > > This issue simply comes down to whether it is reasonable to call > executeResultList when there is no result defined (i.e returning a > candidate). Current implementation assumes that it isn't reasonable > (since why return a candidate in a result object?). Could easily > change, but anyway ... >
The query is not just returning the candidate instances, they should be wrapped into PersonWrapper instances. In order to specify that the result should be wrapped I have to call executeResultList passing the wrapper class (or call setResultClass with the result class). The JDO spec has two similar sample queries in chapter 14.10.15 and chapter 14.10.16 that both store the result in a user defined class and both rely on the default setting for Query.setResult. Regards Michael > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/datanucleus/datanucleus-api-jdo/issues/52#issuecomment-304464716>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AbdDGASaJbkgEXyhatkdSJAmdNhwFFIjks5r-FkIgaJpZM4NoZIP>. > -- Michael Bouschen akquinet tech@spree GmbH Bülowstraße 66 • D-10783 Berlin Tel: +49 30 235520-33 Fax: +49 30 217520-12 E-Mail: michael.bousc...@akquinet.de <mailto:michael.bousc...@akquinet.de> Web: www.akquinet.de <http://www.akquinet.de/> Geschäftsführung: Martin Weber, Dr. Torsten Fink Amtsgericht Berlin HRB 86780 • USt.-Id. Nr.: DE 225 964 680 [Facebook] <http://www.facebook.com/akquinet> [XING] <https://www.xing.com/companies/akquinetag> [G+] <https://plus.google.com/b/111054946250796705170/+akquinet/posts> [LinkedIn] <https://www.linkedin.com/company/akquinet-ag> [Twitter] <https://twitter.com/akquinet>