次のようなクエリを実行するための簡単な JUnit テストを実行しようとしています。
Resource result = ofy().load().type(Resource.class).filter("raw =",
"/Bob/-/userId/-/").first().get();
if (result != null){
System.out.println("Resulting Resource raw =" + result.getRaw());
}
上記のクエリの結果は になりnullますが、id (Long 型) を使用してクエリを実行すると、結果が得られます。クエリしようとしているエンティティを永続化する@Idと、ログに記録され、値は1であるため、次を使用してクエリを実行しidました。
Resource result =
ofy().load().type(Resource.class).filter("id =", 1).first().get();
if (result != null){
System.out.println("Resulting Resource raw =" + result.getRaw());
}
結果result.getRaw()は/Bob/-/userId/-/本当に奇妙です。私の最初のクエリから、結果はそうではなかったはずnullです?