Package play.db.jpa

Class JPAPlugin

  • All Implemented Interfaces:
    java.lang.Comparable<PlayPlugin>

    public class JPAPlugin
    extends PlayPlugin
    • Field Detail

      • autoTxs

        public static boolean autoTxs
    • Constructor Detail

      • JPAPlugin

        public JPAPlugin()
    • Method Detail

      • bind

        public java.lang.Object bind​(Http.Request request,
                                     Scope.Session session,
                                     RootParamNode rootParamNode,
                                     java.lang.String name,
                                     java.lang.Class clazz,
                                     java.lang.reflect.Type type,
                                     java.lang.annotation.Annotation[] annotations)
        Description copied from class: PlayPlugin
        Called when play need to bind a Java object from HTTP params.
        Overrides:
        bind in class PlayPlugin
        rootParamNode - parameters to bind
        name - the name of the object
        clazz - the class of the object to bind
        type - type
        annotations - annotation on the object
        Returns:
        binding object
      • onApplicationStart

        public void onApplicationStart()
        Reads the configuration file and initialises required JPA EntityManagerFactories.
        Overrides:
        onApplicationStart in class PlayPlugin
      • newEntityManagerFactory

        protected javax.persistence.EntityManagerFactory newEntityManagerFactory​(java.lang.String dbName,
                                                                                 Configuration dbConfig)
      • properties

        protected java.util.Properties properties​(java.lang.String dbName,
                                                  Configuration dbConfig)
      • getDefaultDialect

        public static java.lang.String getDefaultDialect​(Configuration dbConfig,
                                                         java.lang.String driver)
      • onApplicationStop

        public void onApplicationStop()
        Description copied from class: PlayPlugin
        Called at application stop (and before each reloading) Time to shutdown stateful things.
        Overrides:
        onApplicationStop in class PlayPlugin
      • afterInvocation

        public void afterInvocation()
        Description copied from class: PlayPlugin
        Called after an invocation. (unless an exception has been thrown). Time to close request specific things.
        Overrides:
        afterInvocation in class PlayPlugin