I'm trying to do a simple JUnit test to do a query like this:
Resource result = ofy().load().type(Resource.class).filter("raw =",
"/Bob/-/userId/-/").first().get();
if (result != null){
System.out.println("Resulting Resource raw =" + result.getRaw());
}
The query above results to null
, however when I do a query using id (which is a Long type) I get the result. When I persisted the entity I'm trying to
query I logged the @Id
and the value is 1
, so I did a query using id
to check:
Resource result =
ofy().load().type(Resource.class).filter("id =", 1).first().get();
if (result != null){
System.out.println("Resulting Resource raw =" + result.getRaw());
}
The resulting result.getRaw()
is /Bob/-/userId/-/
which is really weird, from my first query the result should have not been null
?