Objectify does not return query with a simple filter

0

I'm using Objectify 4.0.1, and I can not make a query with a simple filter return values.

My class is this:

@Entity
public class Jogador implements Serializable{

@Id
private Long id;

private String nome;

private String grupo;
(...)

My code trying to search is this:

List <Jogador> j = ofy().load().type(Jogador.class).filter("nome", "Fernando").list();

The list always comes empty. If I remove the filter, all data is returned normally.

    
asked by anonymous 29.04.2014 / 14:28

1 answer

1

The nome attribute must be indexed by being used in query . To do this use the @Index annotation in the declaration of the name attribute.

    
29.04.2014 / 15:55