1

私はこれだけを見ます:

     /**
     * 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.");
    }

その実装はどこにありますか?つまり、これらのSQLシーケンスはどこに配置されますか?

4

1 に答える 1

0

このコードは、すべてのJPAエンティティに適用されるJPAEnhancerクラスで定義されています。

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);
    ... 
}
于 2013-01-12T08:54:52.857 に答える