Objectify does not return query with a simple filter

Asked

Viewed 46 times

0

I am using Objectify 4.0.1, and cannot query with a simple return value filter.

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, usually.

1 answer

1

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.