データベースからデータを取得してシリアライズしようとすると、プログラムが正しく動作していないようです。次の属性を持つオブジェクトを定義します: id title content isPublic ...
フロントエンド Web アプリケーションに接続するたびに、メモを読み込んでシリアル化し、フロント エンドに表示しようとします。
しかし、メモのリストをシリアル化しようとすると問題が発生しました。以下でこの関数を呼び出すたびに、どこにも終わらず、正しく実行されません。
public static String manyToJSON(Iterable<Note> col) {
// if a collection is serialized do not include the content
String[] attrs = new String[]{
"id",
"title",
"owner.id",
"owner.firstName",
"owner.lastName",
"contacts.id",
"contacts.firstName",
"contacts.lastName",
"contacts.telNr",
"resources.id",
"resources.name",
"createdAt",
"updatedAt",
"isPublic",
"isShared"
};
return new JSONSerializer().include(attrs).exclude("*").serialize(col);
}
明らかな理由ではないでしょうか?どんな助けでも大歓迎です。