0
votes

I have an entity w/ @Id in String type and I managed to insert one record.

When I execute the query below, I am able to see the record returned by the query:

ofy().transactionless().load().type(Score.class).first().now();

However, when I try to query via the id() method, I got zero record.

ofy().transactionless().load().type(Score.class).id("idstring").now;

Any idea what may I have missed?

Thanks!

1

1 Answers

2
votes

Your first query is just producing the first Score entity in the datastore. The second query is looking for a specific key. You probably have the id specified incorrectly.

Also, you almost certainly don't need transactionless() - that is a very special use case.