play.db.jpa
类 JPAPlugin

java.lang.Object
  继承者 play.PlayPlugin
      继承者 play.db.jpa.JPAPlugin
所有已实现的接口:
java.lang.Comparable<PlayPlugin>

public class JPAPlugin
extends PlayPlugin

JPA Plugin


嵌套类摘要
static class JPAPlugin.JPAModelLoader
           
 
字段摘要
static boolean autoTxs
           
 
从类 play.PlayPlugin 继承的字段
index
 
构造方法摘要
JPAPlugin()
           
 
方法摘要
 void afterFixtureLoad()
           
 void afterInvocation()
          Called after an invocation.
 void beforeInvocation()
          Called before a Play!
 java.lang.Object bind(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.
 java.lang.Object bindBean(RootParamNode rootParamNode, java.lang.String name, java.lang.Object bean)
          Called when play need to bind an existing Java object from HTTP params.
protected static void closeTx(boolean rollback)
          clear current JPA context and transaction if JPAPlugin.autoTxs is true When using multiple databases in the same request this method tries to commit/rollback as many transactions as possible, but there is not guaranteed that all transactions are committed.
 void enhance(ApplicationClasses.ApplicationClass applicationClass)
          Enhance this class
protected  java.lang.String getConfigInfoString(java.lang.String configName)
          returns empty string if default config.
 void invocationFinally()
          Called at the end of the invocation.
 Model.Factory modelFactory(java.lang.Class<? extends Model> modelClass)
           
 void onApplicationStart()
          Called at application start (and at each reloading) Time to start stateful things.
 void onApplicationStop()
          Called at application stop (and before each reloading) Time to shutdown stateful things.
 void onInvocationException(java.lang.Throwable e)
          Called if an exception occured during the invocation.
static void startTx(boolean readonly)
          已过时。 use @Transactional with readOnly-property instead
 
从类 play.PlayPlugin 继承的方法
addMimeTypes, addTemplateExtensions, afterActionInvocation, afterApplicationStart, beforeActionInvocation, beforeDetectingChanges, bind, bind, compareTo, compileAll, compileSources, detectChange, detectClassesChange, getJsonStatus, getMessage, getStatus, loadTemplate, onActionInvocationResult, onApplicationReady, onClassesChange, onConfigurationRead, onEvent, onInvocationSuccess, onLoad, onRequestRouting, onRoutesLoaded, onTemplateCompilation, overrideTemplateSource, postEvent, rawInvocation, routeRequest, runTest, serveStatic, unBind, willBeValidated
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

autoTxs

public static boolean autoTxs
构造方法详细信息

JPAPlugin

public JPAPlugin()
方法详细信息

bind

public java.lang.Object bind(RootParamNode rootParamNode,
                             java.lang.String name,
                             java.lang.Class clazz,
                             java.lang.reflect.Type type,
                             java.lang.annotation.Annotation[] annotations)
从类 PlayPlugin 复制的描述
Called when play need to bind a Java object from HTTP params. When overriding this method, do not call super impl.. super impl is calling old bind method to be backward compatible.

覆盖:
PlayPlugin 中的 bind

bindBean

public java.lang.Object bindBean(RootParamNode rootParamNode,
                                 java.lang.String name,
                                 java.lang.Object bean)
从类 PlayPlugin 复制的描述
Called when play need to bind an existing Java object from HTTP params. When overriding this method, DO NOT call the super method, since its default impl is to call the old bind method to be backward compatible.

覆盖:
PlayPlugin 中的 bindBean

enhance

public void enhance(ApplicationClasses.ApplicationClass applicationClass)
             throws java.lang.Exception
从类 PlayPlugin 复制的描述
Enhance this class

覆盖:
PlayPlugin 中的 enhance
抛出:
java.lang.Exception

getConfigInfoString

protected java.lang.String getConfigInfoString(java.lang.String configName)
returns empty string if default config. returns descriptive string about config name if not default config


onApplicationStart

public void onApplicationStart()
从类 PlayPlugin 复制的描述
Called at application start (and at each reloading) Time to start stateful things.

覆盖:
PlayPlugin 中的 onApplicationStart

onApplicationStop

public void onApplicationStop()
从类 PlayPlugin 复制的描述
Called at application stop (and before each reloading) Time to shutdown stateful things.

覆盖:
PlayPlugin 中的 onApplicationStop

beforeInvocation

public void beforeInvocation()
从类 PlayPlugin 复制的描述
Called before a Play! invocation. Time to prepare request specific things.

覆盖:
PlayPlugin 中的 beforeInvocation

afterInvocation

public void afterInvocation()
从类 PlayPlugin 复制的描述
Called after an invocation. (unless an excetion has been thrown). Time to close request specific things.

覆盖:
PlayPlugin 中的 afterInvocation

onInvocationException

public void onInvocationException(java.lang.Throwable e)
从类 PlayPlugin 复制的描述
Called if an exception occured during the invocation.

覆盖:
PlayPlugin 中的 onInvocationException
参数:
e - The catched exception.

invocationFinally

public void invocationFinally()
从类 PlayPlugin 复制的描述
Called at the end of the invocation. (even if an exception occured). Time to close request specific things.

覆盖:
PlayPlugin 中的 invocationFinally

startTx

@Deprecated
public static void startTx(boolean readonly)
已过时。 use @Transactional with readOnly-property instead

initialize the JPA context and starts a JPA transaction if not already started.

This method is not needed since transaction is created automatically on first use.

It is better to specify readonly like this: @Transactional(readOnly=true)

参数:
readonly - true for a readonly transaction

closeTx

protected static void closeTx(boolean rollback)
clear current JPA context and transaction if JPAPlugin.autoTxs is true When using multiple databases in the same request this method tries to commit/rollback as many transactions as possible, but there is not guaranteed that all transactions are committed.

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

modelFactory

public Model.Factory modelFactory(java.lang.Class<? extends Model> modelClass)
覆盖:
PlayPlugin 中的 modelFactory

afterFixtureLoad

public void afterFixtureLoad()
覆盖:
PlayPlugin 中的 afterFixtureLoad


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