5

Windows Azure モバイル サービスを初めて使用します。次のコードを使用して、モバイル サービスを介してテーブルの 1 つで簡単なクエリを実行しています。

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 であることに関係していると思われます。この問題に遭遇した人はいますか?

4

1 に答える 1

2

クライアント パーサー ソースは、データが期待どおりに解析される必要があることを示唆しています。

https://github.com/WindowsAzure/azure-mobile-services/blob/master/sdk/android/src/sdk/src/com/microsoft/windowsazure/mobileservices/DateSerializer.java

使用している Google GSON ライブラリのバージョンを調べて、Mobile Services SDK と互換性があることを確認してください。

于 2013-11-04T12:22:20.520 に答える