我是 Windows Azure 移动服务的新手。我正在通过移动服务使用以下代码在我的一张表上运行一个简单的查询:
mStudySpotTable = this.mClient.getTable(studyspot.class);
mStudySpotTable.where().field("ss_school_id").eq(1)
.execute(new TableQueryCallback<studyspot>() {
public void onCompleted(List<studyspot> result,
int count,
Exception exception,
ServiceFilterResponse response) {
studyspot 类是一个内部类,仅包含与列匹配的变量 在云端存储的表中:
public class studyspot {
int id;
int ss_school_id;
int ss_course_id;
Date ss_startdatetime;
Date ss_enddatetime;
int ss_creator;
}
我遇到的问题是,当我尝试使用上面的查询运行应用程序时,我收到 com.google.gson.JsonSyntaxException: java.text.ParseException "Unparseable date:"2013-11-03T20:00: 00.000Z"
我怀疑这个问题与 ss_startdatetime 和 ss_enddatetime 的类型有关,它们是 Java 中的 Date 对象和 sql 表中的 datetime。有人遇到过这个问题吗?
最佳答案
客户端解析器源代码建议应按预期解析数据:
也许检查您正在使用的 Google GSON 库版本,以确保它与移动服务 SDK 兼容。
关于java - 无法解析的日期异常 Windows Azure 移动服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19763700/