javax.jdo.JDOFatalUserException:非法参数
我尝试像往常一样进行查询,但这次我的查询中需要三个条件。所以我写了一个代码,查询是这样的:
Query query = pm.newQuery(LokationsEntry.class, " personalgroup == 1 && openningtime < now && closingtime > now");
query.declareParameters("java.util.Date now");
entries = (List<LokationsEntry>) query.execute(now);
现在是一个日期参数。
问题是,如果我删除其中一个日期比较,它就可以正常工作。但如果我使用两个日期比较,它会给我这个错误。我需要查询时间介于关闭时间和开放时间之间。你知道如何解决这个难题吗?
I am trying to make a query as usual but this time I need three conditions in my query. So I have written a code and the query is something like this:
Query query = pm.newQuery(LokationsEntry.class, " personalgroup == 1 && openningtime < now && closingtime > now");
query.declareParameters("java.util.Date now");
entries = (List<LokationsEntry>) query.execute(now);
Now is a date parameter.
The problem is that if I remove one of the date comparisons it works fine. But it gives me this error if I use both date comparisons. I need to query so that the time is between closing and opening times. Do you know how to solve this puzzle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该问题是由于谷歌应用程序引擎的记录限制无法通过查询解决。您必须使用自己的代码进行第二次过滤。
The problem is because of the documented limitation of google app engine unsolvable through query. You have to make the second filtering with your own code.