public class JPAPlugin extends PlayPlugin
Modifier and Type | Class and Description |
---|---|
class |
JPAPlugin.TransactionalFilter |
PlayPlugin.Filter<T>
Modifier and Type | Field and Description |
---|---|
static boolean |
autoTxs |
index
Constructor and Description |
---|
JPAPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
afterFixtureLoad() |
void |
afterInvocation()
Called after an invocation.
|
Object |
bind(RootParamNode rootParamNode,
String name,
Class clazz,
Type type,
Annotation[] annotations)
Called when play need to bind a Java object from HTTP params.
|
Object |
bindBean(RootParamNode rootParamNode,
String name,
Object bean)
Called when play need to bind an existing Java object from HTTP params.
|
static void |
closeTx(boolean rollback)
Deprecated.
see
JPA.rollbackTx(java.lang.String) and JPA.closeTx(java.lang.String) method |
static EntityManager |
createEntityManager() |
EntityManager |
em(String key) |
void |
enhance(ApplicationClasses.ApplicationClass applicationClass)
Enhance this class
|
static String |
getDefaultDialect(Configuration dbConfig,
String driver) |
static String |
getDefaultDialect(String driver) |
PlayPlugin.Filter<Object> |
getFilter()
Return the filter implementation for this plugin.
|
Model.Factory |
modelFactory(Class<? extends Model> modelClass) |
void |
onApplicationStart()
Reads the configuration file and initialises required JPA EntityManagerFactories.
|
void |
onApplicationStop()
Called at application stop (and before each reloading)
Time to shutdown stateful things.
|
static void |
startTx(boolean readonly)
Deprecated.
see JPA startTx() method
|
addMimeTypes, addTemplateExtensions, afterActionInvocation, afterApplicationStart, beforeActionInvocation, beforeDetectingChanges, beforeInvocation, bind, bind, compareTo, compileAll, compileSources, detectChange, detectClassesChange, getFunctionalTests, getJsonStatus, getMessage, getStatus, getUnitTests, hasFilter, invocationFinally, loadTemplate, onActionInvocationFinally, onActionInvocationResult, onApplicationReady, onClassesChange, onConfigurationRead, onEvent, onInvocationException, onInvocationSuccess, onLoad, onRequestRouting, onRoutesLoaded, onTemplateCompilation, overrideTemplateSource, postEvent, rawInvocation, routeRequest, runTest, serveStatic, unBind, willBeValidated
public Object bind(RootParamNode rootParamNode, String name, Class clazz, Type type, Annotation[] annotations)
PlayPlugin
bind
in class PlayPlugin
public Object bindBean(RootParamNode rootParamNode, String name, Object bean)
PlayPlugin
bindBean
in class PlayPlugin
public void enhance(ApplicationClasses.ApplicationClass applicationClass) throws Exception
PlayPlugin
enhance
in class PlayPlugin
Exception
public EntityManager em(String key)
public void onApplicationStart()
onApplicationStart
in class PlayPlugin
public static String getDefaultDialect(Configuration dbConfig, String driver)
public void onApplicationStop()
PlayPlugin
onApplicationStop
in class PlayPlugin
public void afterFixtureLoad()
afterFixtureLoad
in class PlayPlugin
public void afterInvocation()
PlayPlugin
afterInvocation
in class PlayPlugin
public PlayPlugin.Filter<Object> getFilter()
PlayPlugin
getFilter
in class PlayPlugin
public static EntityManager createEntityManager()
@Deprecated public static void startTx(boolean readonly)
readonly
- true for a readonly transaction@Deprecated public static void closeTx(boolean rollback)
JPA.rollbackTx(java.lang.String)
and JPA.closeTx(java.lang.String)
methodrollback
- shall current transaction be committed (false) or cancelled (true)public Model.Factory modelFactory(Class<? extends Model> modelClass)
modelFactory
in class PlayPlugin
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly