java.lang.Object
com.atlassian.confluence.core.persistence.hibernate.SessionHelper

@Deprecated(since="9.3") public final class SessionHelper extends Object
Deprecated.
since 9.3
Provides utility methods for invoking Session objects using hibernate v2 method signatures, that have since been removed.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hibernate.query.NativeQuery
    createNativeQuery(org.hibernate.Session session, String sql, String[] returnAliases, Class[] returnClasses)
    Deprecated.
    since 9.3
    static org.hibernate.query.Query
    createQuery(org.hibernate.Session session, String queryString, Object[] values, org.hibernate.type.Type[] types)
    Deprecated.
    since 9.3
    static org.hibernate.query.Query
    createQuery(org.hibernate.Session session, String queryString, Object value, org.hibernate.type.Type type)
    Deprecated.
    since 9.3
    static int
    delete(org.hibernate.Session session, String query, Object[] values, org.hibernate.type.Type[] types)
    Deprecated.
    since 9.3
    static void
    save(org.hibernate.Session session, Object object, Serializable id)
    Deprecated.
    since 9.3

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • save

      @Deprecated(since="9.3") public static void save(org.hibernate.Session session, Object object, Serializable id) throws org.hibernate.HibernateException
      Deprecated.
      since 9.3
      Persist the given transient instance, using the given identifier.
      Parameters:
      session - the Session object
      object - a transient instance of a persistent class
      id - an unused valid identifier
      Throws:
      org.hibernate.HibernateException - when the entity could not be saved
    • delete

      @Deprecated(since="9.3") public static int delete(org.hibernate.Session session, String query, Object[] values, org.hibernate.type.Type[] types) throws org.hibernate.HibernateException
      Deprecated.
      since 9.3
      Delete all objects returned by the query. Return the number of objects deleted.
      Parameters:
      session - the Session object
      query - the query string
      values - a list of values to be written to parameters in the query.
      types - a list of Hibernate types of the values
      Returns:
      the number of instances deleted
      Throws:
      org.hibernate.HibernateException - when the entities could not be deleted
    • createQuery

      @Deprecated(since="9.3") public static org.hibernate.query.Query createQuery(org.hibernate.Session session, String queryString, Object value, org.hibernate.type.Type type) throws org.hibernate.HibernateException
      Deprecated.
      since 9.3
      Create a new instance of Query for the given query string and bind parameter.

      Bind a value to a parameter in the query string.

      Parameters:
      session - the Session object
      queryString - the query string
      value - a value to be bound to a placeholder (JDBC IN parameter).
      type - the Hibernate type of the value
      Returns:
      Query
      Throws:
      org.hibernate.HibernateException - when the query could not be created
    • createQuery

      @Deprecated(since="9.3") public static org.hibernate.query.Query createQuery(org.hibernate.Session session, String queryString, Object[] values, org.hibernate.type.Type[] types) throws org.hibernate.HibernateException
      Deprecated.
      since 9.3
      Create a new instance of Query for the given query string and bind parameters.

      Binding an array of values to parameters in the query string.

      Parameters:
      session - the Session object
      queryString - the query string
      values - an array of values to be bound to the parameters
      types - an array of Hibernate types of the values
      Returns:
      Query
      Throws:
      org.hibernate.HibernateException - when the query could not be created
    • createNativeQuery

      @Deprecated(since="9.3") public static org.hibernate.query.NativeQuery createNativeQuery(org.hibernate.Session session, String sql, String[] returnAliases, Class[] returnClasses)
      Deprecated.
      since 9.3
      Create a new instance of Query for the given SQL string.
      Parameters:
      sql - a query expressed in SQL
      returnAliases - an array of table aliases that appear inside {} in the SQL string
      returnClasses - the returned persistent classes