如何在 Objectify 中按字符串过滤
How to filter by String in Objectify
这是我的问题
String text = "I am here"
resutl = ofy().load().type(M.class).filter("good = "+text).first().now();
由于 text
包含 space,我该如何将其传递给 Objectify?我是否将它放在单引号中?双引号?什么?
filter()
方法有两个参数:
ofy().load().type(M.class).filter("good =", text).first().now();
不需要对值进行转义。
ofy().load().type(M.class).filter("good",text).first().now()
不需要“=”。它是默认运算符。
这是我的问题
String text = "I am here"
resutl = ofy().load().type(M.class).filter("good = "+text).first().now();
由于 text
包含 space,我该如何将其传递给 Objectify?我是否将它放在单引号中?双引号?什么?
filter()
方法有两个参数:
ofy().load().type(M.class).filter("good =", text).first().now();
不需要对值进行转义。
ofy().load().type(M.class).filter("good",text).first().now()
不需要“=”。它是默认运算符。