Take a look at the objectify wiki . The Query Execution section contains examples of how to create basic queries.
Let's assume that your entity looks something like this:
@Entity
public class Salary {
Ref<Employee> employee;
@Id
Long salaryId;
@Index
Date startDate;
@Index
Date endDate;
Long salaryCents;
}
, , :
ofy().load(Salary.class).filter("startDate >", start).filter("startDate <=", end).list();
datastore docs * 'you ,
ofy().load(Salary.class).filter("startDate >", start).filter("endDate <=", end).list();
.
, Java-.
( , ) , :
Iterable<Key<Salary>> keys = ofy().load(Salary.class).filter("startDate >", start).keys();
:
ofy().load(Salary.class).filter("salaryId IN", keys).filter("endDate <=", end).list();
, IN , in-memory , .
, .