GAE/J メモ

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
エンティティを makePersistent するとシステムエラー。

java.lang.UnsupportedOperationException

エンティティに使用できないデータ型をアサインしていた。(この時は Calendarクラス)
http://code.google.com/intl/ja/appengine/docs/java/datastore/entities.html#Properties_and_Value_Types


■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Exception thrown
Persistent class "Class worktimereport.datastore.entity.WorktimeMonthlyEntity does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.
org.datanucleus.store.exceptions.NoTableManagedException: Persistent class ...

[プロジェクト(P)]⇒[クリーン(N)]で回避。
データストア用のキャッシュが邪魔しているらしく、それをクリアする。


■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
@Persistent アノテーションの defaultFetchGroup

PersistenceManager#getObjectById() で取得したオブジェクトに Serializable なプロパティ(子オブジェクト)が存在する環境において、
その Serializable なプロパティ(子オブジェクト)にデータをロードする方法は、以下の2つのいずれか。
 ①PersistenceManager#close が呼び出されるまでに、同プロパティにアクセス(フェッチ)する。
 ②Serializable なプロパティ(子オブジェクト)の @Persistent アノテーションの defaultFetchGroup を true に設定する。
そうしないとプロパティは null(未ロード) の状態のままとなります。

@Persistent(defaultFetchGroup = "true")
private List wte;