Package play.db.jpa
Class JPAPlugin
- java.lang.Object
-
- play.PlayPlugin
-
- play.db.jpa.JPAPlugin
-
- All Implemented Interfaces:
java.lang.Comparable<PlayPlugin>
public class JPAPlugin extends PlayPlugin
-
-
Field Summary
Fields Modifier and Type Field Description static booleanautoTxs-
Fields inherited from class play.PlayPlugin
index
-
-
Constructor Summary
Constructors Constructor Description JPAPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterInvocation()Called after an invocation.java.lang.Objectbind(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)Called when play need to bind a Java object from HTTP params.static java.lang.StringgetDefaultDialect(Configuration dbConfig, java.lang.String driver)protected javax.persistence.EntityManagerFactorynewEntityManagerFactory(java.lang.String dbName, Configuration dbConfig)voidonApplicationStart()Reads the configuration file and initialises required JPA EntityManagerFactories.voidonApplicationStop()Called at application stop (and before each reloading) Time to shutdown stateful things.protected PersistenceUnitInfoImplpersistenceUnitInfo(java.lang.String dbName, Configuration dbConfig)protected java.util.Propertiesproperties(java.lang.String dbName, Configuration dbConfig)-
Methods inherited from class play.PlayPlugin
afterActionInvocation, afterApplicationStart, beforeActionInvocation, beforeInvocation, compareTo, detectChange, disable, getJsonStatus, getMessage, getStatus, isEnabled, loadTemplate, onActionInvocationException, onActionInvocationFinally, onActionInvocationResult, onActionInvocationResult, onConfigurationRead, onInvocationSuccess, onJobInvocationException, onJobInvocationFinally, onLoad, rawInvocation, routeRequest
-
-
-
-
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:PlayPluginCalled when play need to bind a Java object from HTTP params.- Overrides:
bindin classPlayPluginrootParamNode- parameters to bindname- the name of the objectclazz- the class of the object to bindtype- typeannotations- annotation on the object- Returns:
- binding object
-
onApplicationStart
public void onApplicationStart()
Reads the configuration file and initialises required JPA EntityManagerFactories.- Overrides:
onApplicationStartin classPlayPlugin
-
newEntityManagerFactory
protected javax.persistence.EntityManagerFactory newEntityManagerFactory(java.lang.String dbName, Configuration dbConfig)
-
persistenceUnitInfo
protected PersistenceUnitInfoImpl persistenceUnitInfo(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:PlayPluginCalled at application stop (and before each reloading) Time to shutdown stateful things.- Overrides:
onApplicationStopin classPlayPlugin
-
afterInvocation
public void afterInvocation()
Description copied from class:PlayPluginCalled after an invocation. (unless an exception has been thrown). Time to close request specific things.- Overrides:
afterInvocationin classPlayPlugin
-
-