程序包 org.hibernate

接口 SharedSessionContract

    • 方法详细资料

      • getTenantIdentifier

        String getTenantIdentifier()
        Obtain the tenant identifier associated with this session.
        返回:
        The tenant identifier associated with this session, or null
      • isOpen

        boolean isOpen()
        Check if the session is still open.
        返回:
        boolean
      • isConnected

        boolean isConnected()
        Check if the session is currently connected.
        返回:
        boolean
      • beginTransaction

        Transaction beginTransaction()
        Begin a unit of work and return the associated Transaction object. If a new underlying transaction is required, begin the transaction. Otherwise continue the new work in the context of the existing underlying transaction.
        返回:
        a Transaction instance
        另请参阅:
        getTransaction()
      • getTransaction

        Transaction getTransaction()
        Get the Transaction instance associated with this session. The concrete type of the returned Transaction object is determined by the hibernate.transaction_factory property.
        返回:
        a Transaction instance
      • createQuery

        Query createQuery​(String queryString)
        从接口复制的说明: QueryProducer
        Create a Query instance for the given HQL/JPQL query string.
        指定者:
        createQuery 在接口中 QueryProducer
        参数:
        queryString - The HQL/JPQL query
        返回:
        The Query instance for manipulation and execution
        另请参阅:
        EntityManager.createQuery(String)
      • getNamedQuery

        Query getNamedQuery​(String queryName)
        从接口复制的说明: QueryProducer
        Create a Query instance for the named query.
        指定者:
        getNamedQuery 在接口中 QueryProducer
        参数:
        queryName - the name of a pre-defined, named query
        返回:
        The Query instance for manipulation and execution
      • getNamedProcedureCall

        ProcedureCall getNamedProcedureCall​(String name)
        Gets a ProcedureCall based on a named template
        参数:
        name - The name given to the template
        返回:
        The ProcedureCall
        另请参阅:
        NamedStoredProcedureQuery
      • createStoredProcedureCall

        ProcedureCall createStoredProcedureCall​(String procedureName)
        Creates a call to a stored procedure.
        参数:
        procedureName - The name of the procedure.
        返回:
        The representation of the procedure call.
      • createStoredProcedureCall

        ProcedureCall createStoredProcedureCall​(String procedureName,
                                                Class... resultClasses)
        Creates a call to a stored procedure with specific result set entity mappings. Each class named is considered a "root return".
        参数:
        procedureName - The name of the procedure.
        resultClasses - The entity(s) to map the result on to.
        返回:
        The representation of the procedure call.
      • createStoredProcedureCall

        ProcedureCall createStoredProcedureCall​(String procedureName,
                                                String... resultSetMappings)
        Creates a call to a stored procedure with specific result set entity mappings.
        参数:
        procedureName - The name of the procedure.
        resultSetMappings - The explicit result set mapping(s) to use for mapping the results
        返回:
        The representation of the procedure call.
      • createCriteria

        @Deprecated
        Criteria createCriteria​(Class persistentClass)
        已过时。
        (since 5.2) for Session, use the JPA Criteria
        Create Criteria instance for the given class (entity or subclasses/implementors).
        参数:
        persistentClass - The class, which is an entity, or has entity subclasses/implementors
        返回:
        The criteria instance for manipulation and execution
      • createCriteria

        @Deprecated
        Criteria createCriteria​(Class persistentClass,
                                String alias)
        已过时。
        (since 5.2) for Session, use the JPA Criteria
        Create Criteria instance for the given class (entity or subclasses/implementors), using a specific alias.
        参数:
        persistentClass - The class, which is an entity, or has entity subclasses/implementors
        alias - The alias to use
        返回:
        The criteria instance for manipulation and execution
      • createCriteria

        @Deprecated
        Criteria createCriteria​(String entityName)
        已过时。
        (since 5.2) for Session, use the JPA Criteria
        Create Criteria instance for the given entity name.
        参数:
        entityName - The entity name
        返回:
        The criteria instance for manipulation and execution
      • createCriteria

        @Deprecated
        Criteria createCriteria​(String entityName,
                                String alias)
        已过时。
        (since 5.2) for Session, use the JPA Criteria
        Create Criteria instance for the given entity name, using a specific alias.
        参数:
        entityName - The entity name
        alias - The alias to use
        返回:
        The criteria instance for manipulation and execution
      • doWork

        default void doWork​(Work work)
                     throws HibernateException
        Controller for allowing users to perform JDBC related work using the Connection managed by this Session.
        参数:
        work - The work to be performed.
        抛出:
        HibernateException - Generally indicates wrapped SQLException