WHERE 上的 GQL 错误
select from comments.Comment
where ownerType == 'looks.Look'
AND ownerName == 'Yakuza' order by date
我得到异常:
Portion of expression could not be parsed: AND ownerName == 'Yakuza'
虽然这个查询工作得很好:
select from comments.Comment
where ownerType == 'looks.Look'
order by date
这也是:
select from comments.Comment
where ownerName == 'Yakuza' order by date
完整的代码:
PersistenceManager pm = PMF.get().getPersistenceManager();
String query = "... query goes here ...";
List<Comment> comments = null;
try {
comments = (List<Comment>) pm.newQuery(query).execute();
}
...
select from comments.Comment
where ownerType == 'looks.Look'
AND ownerName == 'Yakuza' order by date
I get exception:
Portion of expression could not be parsed: AND ownerName == 'Yakuza'
While this query works nice:
select from comments.Comment
where ownerType == 'looks.Look'
order by date
And this too:
select from comments.Comment
where ownerName == 'Yakuza' order by date
The full code:
PersistenceManager pm = PMF.get().getPersistenceManager();
String query = "... query goes here ...";
List<Comment> comments = null;
try {
comments = (List<Comment>) pm.newQuery(query).execute();
}
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将“AND”替换为“&&”
Replace "AND" with "&&"