我的类导入,就是这样:
package models;
import java.util.Date;
import javax.persistence.Entity;
import play.db.jpa.Model;
import play.mvc.Scope.Session;
import constantes.CommonConstants;
@javax.persistence.Entity
public class ImportCSV extends Model {
public ImportCSV() {
if (null != Session.current()) {
this.CreatedBy = Session.current().get(CommonConstants.SESS_ID_UO_LOGIN);
this.uoSite = Session.current().get(CommonConstants.SESS_ID_UO_SITE);
this.uoRealm = Session.current().get(CommonConstants.SESS_ID_UO_REALM);
}
}
public String dataType;
public String csvFileName;
public String fileStatus;
public Date CreateAt;
public String CreatedBy;
public String uoSite;
public String uoRealm;
public Date LoadedAt;
public String realmImporte;
public String siteImporte;
}
但是,当我尝试ImportCSV.findById(34);
时,代码在Play中没有进一步发展! 1.4.4。
我尝试在Eclipse下以调试模式监视此行,并抛出
java.lang.UnsupportedOperationException: Please annotate your JPA model with @javax.persistence.Entity annotation.
at play.db.jpa.JPASupport.findById(JPASupport.java:385)
at jobs.ImportCSVJob.onException(ImportCSVJob.java:92)
at play.jobs.Job.call(Job.java:127)