Playframework 其中';这是GenericModel.findAll的实现!框架?
我只看到:Playframework 其中';这是GenericModel.findAll的实现!框架?,playframework,Playframework,我只看到: /** * Find all entities of this type */ public static <T extends JPABase> List<T> findAll() { throw new UnsupportedOperationException("Please annotate your JPA model with @javax.persistence.Entity annotati
/**
* Find all entities of this type
*/
public static <T extends JPABase> List<T> findAll() {
throw new UnsupportedOperationException("Please annotate your JPA model with @javax.persistence.Entity annotation.");
}
/**
*查找此类型的所有实体
*/
公共静态列表findAll(){
抛出新的UnsupportedOperationException(“请用@javax.persistence.Entity annotation注释您的JPA模型”);
}
它的实施情况如何?我的意思是,这些SQL序列放在哪里?此代码在JPAEnhancer类中定义,该类应用于所有JPA实体:
public class JPAEnhancer extends Enhancer {
public void enhanceThisClass(ApplicationClass applicationClass) throws Exception {
CtClass ctClass = makeClass(applicationClass);
...
// findAll
CtMethod findAll = CtMethod.make("public static java.util.List findAll() { return play.db.jpa.JPQL.instance.findAll(\"" + entityName + "\"); }", ctClass);
ctClass.addMethod(findAll);
...
}
PS:如果需要查看sql Generated,请在yoru application.conf中将以下属性设置为true:jpa.debugSQL=true