Interface JpaTransactionManager

    • Method Detail

      • getEntityManager

        javax.persistence.EntityManager getEntityManager()
        Returns the EntityManager for the current request.
      • query

        <T> javax.persistence.TypedQuery<T> query​(java.lang.String sqlString,
                                                  java.lang.Class<T> resultClass)
        Creates a JPA SQL query for the given query string and result class.

        This is a convenience method for the longer jpaTm().getEntityManager().createQuery(...).

      • criteriaQuery

        <T> javax.persistence.TypedQuery<T> criteriaQuery​(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
        Creates a JPA SQU query for the given criteria query.
      • query

        javax.persistence.Query query​(java.lang.String sqlString)
        Creates a JPA SQL query for the given query string.

        This is a convenience method for the longer jpaTm().getEntityManager().createQuery(...).

        Note that while this method can legally be used for queries that return results, it should not be, as it does not correctly detach entities as must be done for nomulus model objects.

      • transactWithoutBackup

        <T> T transactWithoutBackup​(java.util.function.Supplier<T> work)
        Execute the work in a transaction without recording the transaction for replay to datastore.
      • transactNoRetry

        <T> T transactNoRetry​(java.util.function.Supplier<T> work)
        Executes the work in a transaction with no retries and returns the result.
      • transactNoRetry

        void transactNoRetry​(java.lang.Runnable work)
        Executes the work in a transaction with no retries.
      • assertDelete

        <T> void assertDelete​(VKey<T> key)
        Deletes the entity by its id, throws exception if the entity is not deleted.
      • teardown

        void teardown()
        Releases all resources and shuts down.

        The errorprone check forbids injection of Closeable resources.

      • setQueryFetchSize

        static javax.persistence.Query setQueryFetchSize​(javax.persistence.Query query,
                                                         int fetchSize)
        Sets the JDBC driver fetch size for the query. This overrides the default configuration.