Interface HibernateEntityManagerImplementor

    • Method Detail

      • checkOpen

        void checkOpen​(boolean markForRollbackIfClosed)
                throws java.lang.IllegalStateException
        Used to ensure the EntityManager is open, throwing IllegalStateException if it is closed. Depending on the value of markForRollbackIfClosed, may also rollback any enlisted-in transaction. This distinction is made across various sections of the spec. Most failed checks should rollback. Section 3.10.7 (per 2.1 spec) lists cases related to calls on related query objects that should not rollback.
        markForRollbackIfClosed - If the EM is closed, should the transaction (if one) be marked for rollback?
        java.lang.IllegalStateException - Thrown if the EM is closed
      • isTransactionInProgress

        boolean isTransactionInProgress()
        Provides access to whether a transaction is currently in progress.
        True if a transaction is considered currently in progress; false otherwise.
      • markForRollbackOnly

        void markForRollbackOnly()
        Used to mark a transaction for rollback only (when that is the JPA spec defined behavior).
      • buildLockOptions

        default LockOptions buildLockOptions​(LockModeType lockModeType,
                                             java.util.Map<java.lang.String,​java.lang.Object> properties)
        Given a JPA LockModeType and properties, build a Hibernate LockOptions
        lockModeType - the requested LockModeType
        properties - the lock properties
        the LockOptions
      • createQuery

        <T> Query<T> createQuery​(java.lang.String jpaqlString,
                                 java.lang.Class<T> resultClass,
                                 Selection selection,
                                 HibernateEntityManagerImplementor.QueryOptions queryOptions)
        (since 5.2) this method form is used to construct a "compiled" representation of a JPA Criteria query. However it assumes the old yucky implementation of "compilation" that converted the Criteria into a HQL/JPQL string. In 6.0 that is re-written from scratch to compile to SQM, and so this method would not be needed in 6.0
        Used during "compiling" a JPA criteria query.
        Type Parameters:
        T - The query type
        jpaqlString - The criteria query rendered as a JPA QL string
        resultClass - The result type (the type expected in the result list)
        selection - The selection(s)
        queryOptions - The options to use to build the query.
        The typed query