I am experimenting with App Engine, Datastore, and Objectify 4. I have an Objectify work query that retrieves all objects of a given type from a data store. I am trying to sort the result based on date:
List<MyEntity> entities = OfyService.ofy().load().type(MyEntity.class).order("-createdDate").list();
But after adding the order, the query returns 0 records. This is my entity class:
@Entity
public class MyEntity
{
@Id Long id;
Long userID;
@Ignore String username;
@Index String name;
String url;
String description;
@Index Date createdDate;
@Index int viewCount;
}
I tried to order other data types without success. Why is this happening?
source
share