Class SessionHelper
java.lang.Object
com.atlassian.confluence.core.persistence.hibernate.SessionHelper
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 TypeMethodDescriptionstatic org.hibernate.query.NativeQuerycreateNativeQuery(org.hibernate.Session session, String sql, String[] returnAliases, Class[] returnClasses) Deprecated.since 9.3static org.hibernate.query.QuerycreateQuery(org.hibernate.Session session, String queryString, Object[] values, org.hibernate.type.Type[] types) Deprecated.since 9.3static org.hibernate.query.QuerycreateQuery(org.hibernate.Session session, String queryString, Object value, org.hibernate.type.Type type) Deprecated.since 9.3static intdelete(org.hibernate.Session session, String query, Object[] values, org.hibernate.type.Type[] types) Deprecated.since 9.3static voidsave(org.hibernate.Session session, Object object, Serializable id) Deprecated.since 9.3
-
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.3Persist the given transient instance, using the given identifier.- Parameters:
session- the Session objectobject- a transient instance of a persistent classid- 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.3Delete all objects returned by the query. Return the number of objects deleted.- Parameters:
session- the Session objectquery- the query stringvalues- 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.3Create 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 objectqueryString- the query stringvalue- 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.3Create 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 objectqueryString- the query stringvalues- an array of values to be bound to the parameterstypes- 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.3Create a new instance of Query for the given SQL string.- Parameters:
sql- a query expressed in SQLreturnAliases- an array of table aliases that appear inside {} in the SQL stringreturnClasses- the returned persistent classes
-