play.db.jpa
Class JPAPlugin

java.lang.Object
  extended by play.PlayPlugin
      extended by play.db.jpa.JPAPlugin
All Implemented Interfaces:
java.lang.Comparable<PlayPlugin>

public class JPAPlugin
extends PlayPlugin

JPA Plugin


Field Summary
static boolean autoTxs
           
 
Fields inherited from class play.PlayPlugin
index
 
Constructor Summary
JPAPlugin()
           
 
Method Summary
 void afterActionInvocation()
          Called at the end of the action invocation.
 void afterInvocation()
          Called after an invocation.
 void beforeInvocation()
          Called before a Play! invocation.
static void closeTx(boolean rollback)
          clear current JPA context and transaction
 void invocationFinally()
          Called at the end of the invocation.
 void onApplicationStart()
          Called at application start (and at each reloading) Time to start statefull things.
 void onApplicationStop()
          Called at application stop (and before each reloading) Time to shutdown statefull things.
 void onInvocationException(java.lang.Throwable e)
          Called if an exception occured during the invocation.
static void startTx(boolean readonly)
          initialize the JPA context and starts a JPA transaction
 
Methods inherited from class play.PlayPlugin
afterApplicationStart, beforeActionInvocation, compareTo, compileAll, detectChange, enhance, getStatus, onActionInvocationResult, onConfigurationRead, onEvent, onLoad, onRoutesLoaded, postEvent, rawInvocation, routeRequest, serveStatic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

autoTxs

public static boolean autoTxs
Constructor Detail

JPAPlugin

public JPAPlugin()
Method Detail

onApplicationStart

public void onApplicationStart()
Description copied from class: PlayPlugin
Called at application start (and at each reloading) Time to start statefull things.

Overrides:
onApplicationStart in class PlayPlugin

onApplicationStop

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

Overrides:
onApplicationStop in class PlayPlugin

beforeInvocation

public void beforeInvocation()
Description copied from class: PlayPlugin
Called before a Play! invocation. Time to prepare request specific things.

Overrides:
beforeInvocation in class PlayPlugin

afterInvocation

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

Overrides:
afterInvocation in class PlayPlugin

afterActionInvocation

public void afterActionInvocation()
Description copied from class: PlayPlugin
Called at the end of the action invocation.

Overrides:
afterActionInvocation in class PlayPlugin

onInvocationException

public void onInvocationException(java.lang.Throwable e)
Description copied from class: PlayPlugin
Called if an exception occured during the invocation.

Overrides:
onInvocationException in class PlayPlugin
Parameters:
e - The catched exception.

invocationFinally

public void invocationFinally()
Description copied from class: PlayPlugin
Called at the end of the invocation. (even if an exception occured). Time to close request specific things.

Overrides:
invocationFinally in class PlayPlugin

startTx

public static void startTx(boolean readonly)
initialize the JPA context and starts a JPA transaction

Parameters:
readonly - true for a readonly transaction

closeTx

public static void closeTx(boolean rollback)
clear current JPA context and transaction

Parameters:
rollback - shall current transaction be committed (false) or cancelled (true)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly