org.springframework.orm.jpa.support

Class OpenEntityManagerInViewInterceptor

    • Field Detail

      • PARTICIPATE_SUFFIX

        public static final java.lang.String PARTICIPATE_SUFFIX
        Suffix that gets appended to the EntityManagerFactory toString representation for the "participate in existing entity manager handling" request attribute.
        See Also:
        getParticipateAttributeName(), Constant Field Values
    • Constructor Detail

      • OpenEntityManagerInViewInterceptor

        public OpenEntityManagerInViewInterceptor()
    • Method Detail

      • postHandle

        public void postHandle(WebRequest request,
                               @Nullable
                               ModelMap model)
        Description copied from interface: WebRequestInterceptor
        Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).

        Allows for modifying context resources after successful handler execution (for example, flushing a Hibernate Session).

        Specified by:
        postHandle in interface WebRequestInterceptor
        Parameters:
        request - the current web request
        model - the map of model objects that will be exposed to the view (may be null). Can be used to analyze the exposed model and/or to add further model attributes, if desired.
      • afterCompletion

        public void afterCompletion(WebRequest request,
                                    @Nullable
                                    java.lang.Exception ex)
                             throws DataAccessException
        Description copied from interface: WebRequestInterceptor
        Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup.

        Note: Will only be called if this interceptor's preHandle method has successfully completed!

        Specified by:
        afterCompletion in interface WebRequestInterceptor
        Parameters:
        request - the current web request
        ex - exception thrown on handler execution, if any
        Throws:
        DataAccessException
      • getParticipateAttributeName

        protected java.lang.String getParticipateAttributeName()
        Return the name of the request attribute that identifies that a request is already filtered. Default implementation takes the toString representation of the EntityManagerFactory instance and appends ".FILTERED".
        See Also:
        PARTICIPATE_SUFFIX