Closed GoogleCodeExporter closed 9 years ago
I'm not quite sure if there is a clean way around this generics issue, but the
"correct" way to solve it with the current API is a cast:
List<Car> range = (List<Car>)ofy().load().filterKey(">=",
startKey).filterKey("<", endKey).list();
Specifying type() has a specific meaning - it issues a query for that specific
type, whereas typeless load() could return any type (and thus returns
List<Object>).
I have updated the docs. Thanks for catching that.
Original comment by lhori...@gmail.com
on 5 Feb 2015 at 6:23
Casting would require a raw (List) cast. Instead I just changed the docs to
return List<Object>. The examples are not supposed to be a tutorial on java's
lousy implementation of generics :-/
Original comment by lhori...@gmail.com
on 5 Feb 2015 at 6:28
Original issue reported on code.google.com by
oliver.h...@gmail.com
on 5 Feb 2015 at 1:45