私は、 scala 2.10でplayframework 2.2.1を使用しており、mysql db には SORM 0.3.10 を使用しています。単純なケース クラスのインスタンスを保存しようとしているとき:
case class User(email: String, password: String, token: String, verified: Boolean = false, atoken: UserAuthToken) {
def save = Db.save[User](this)
}
私はこのエラーを取得しています:
sorm.core.SormException: Attempt to refer to an unpersisted entity: UserAuthToken(7779235c1fd045f39ced7674a45baaa2,1387039847)
私が間違っていることは何ですか?UserAuthToken
も非常に簡単です:
case class UserAuthToken(token: String = UUID.randomUUID().toString.replace("-",""), expire: Int = (Calendar.getInstance().getTimeInMillis/1000).toInt + 60*60*365)
どちらのクラスも Db オブジェクトにエンティティとして登録されています。