1. 程式人生 > >play使用morphia連線mongoDB資料庫報錯

play使用morphia連線mongoDB資料庫報錯

Error during job execution (jobs.LoadCachestatsinfo)

Execution exception (In /app/jobs/LoadCachestatsinfo.java around line 58)
UnsupportedOperationException occured : Please override this method for user marked Id field entity: models.Cachestatsinfo

play.exceptions.JavaExecutionException: Please override this method for user marked Id field entity: models.Cachestatsinfo
    at play.jobs.Job.call(Job.java:216)
    at Invocation.Job(Play!)
Caused by: java.lang.UnsupportedOperationException: Please override this method for user marked Id field entity: models.Cachestatsinfo

這個錯誤是因為使用了jpa的@Entity註釋引起的,

修改為:

import com.google.code.morphia.annotations.Entity;

就好了