public final class DataAccessUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
filterToExistingTables(Set<String> tableNames,
org.springframework.transaction.PlatformTransactionManager transactionManager,
net.sf.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.20.0. Use
filterToExistingTables(Set, PlatformTransactionManager, org.hibernate.SessionFactory) instead. |
static Set<String> |
filterToExistingTables(Set<String> tableNames,
org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory) |
static void |
flush(net.sf.hibernate.Session session)
Deprecated.
since 7.16.0 due to Hibernate 2 removal.
|
static void |
flushAndClear(net.sf.hibernate.Session session)
Deprecated.
since 7.16.0 due to Hibernate 2 removal.
|
static Connection |
getConnection(net.sf.hibernate.Session session)
Deprecated.
since 7.16.0 due to Hibernate 2 removal.
|
static Connection |
getConnection(org.hibernate.Session session)
Deprecated.
since 7.16.0 due to Hibernate 2 removal.
|
static org.hibernate.tool.schema.extract.spi.DatabaseInformation |
getDatabaseInformation(Connection connection,
org.hibernate.SessionFactory sessionFactory)
Get
DatabaseInformation from Hibernate 5 to access database meta information as a replacement of DatabaseMetadata from Hibernate 2 |
static net.sf.hibernate.dialect.Dialect |
getDialect()
Deprecated.
since 7.16.0 due to Hibernate 2 removal. Use
DataAccessUtils.getDialect() instead. |
static net.sf.hibernate.dialect.Dialect |
getDialect(ConfluenceHibernateConfig hibernateConfig)
Deprecated.
since 7.16.0 due to Hibernate 2 removal. Use
com.atlassian.confluence.impl.hibernate.DataAccessUtils#getDialect(ConfluenceHibernateConfig) instead. |
static net.sf.hibernate.dialect.Dialect |
getDialect(com.atlassian.config.db.HibernateConfig hibernateConfig)
Deprecated.
since 7.20 Use
DataAccessUtils.getDialect(com.atlassian.config.db.HibernateConfig) instead. |
static org.hibernate.dialect.Dialect |
getDialectV5()
Deprecated.
since 6.4.1. Use
DataAccessUtils.getDialect() instead. |
static org.hibernate.dialect.Dialect |
getDialectV5(ConfluenceHibernateConfig hibernateConfig)
Deprecated.
since 6.4.1. Use
DataAccessUtils.getDialect(com.atlassian.config.db.HibernateConfig) instead. |
static org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate(net.sf.hibernate.Session session)
Deprecated.
since 7.20.0 due to Hibernate 2 removal. Use
DataAccessUtils.getJdbcTemplate(org.hibernate.Session) instead. |
static org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate(org.hibernate.Session session)
Deprecated.
since 7.18.0 due to Hibernate 2 removal. Use
DataAccessUtils.getJdbcTemplate(org.hibernate.Session) instead. |
static org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate(net.sf.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.20.0 due to Hibernate 2 removal. Use
DataAccessUtils.getJdbcTemplate(org.hibernate.Session) instead. |
static org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate(org.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.18.0 due to Hibernate 2 removal.
|
static String |
getPrimaryKeyColumnName(org.springframework.transaction.PlatformTransactionManager transactionManager,
net.sf.hibernate.SessionFactory sessionFactory,
String tableName)
Deprecated.
since 7.20.0. Use
getPrimaryKeyColumnName(PlatformTransactionManager, org.hibernate.SessionFactory, String) instead. |
static String |
getPrimaryKeyColumnName(org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory,
String tableName)
Locates the name of the column used as the primary key on the given table.
|
static org.hibernate.Session |
getSession(org.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.16.0 due to Hibernate 2 removal.
|
static net.sf.hibernate.Session |
getSession(net.sf.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.16.0 due to Hibernate 2 removal.
|
static boolean |
isColumnPresent(String tableName,
String columnName,
org.springframework.transaction.PlatformTransactionManager transactionManager,
net.sf.hibernate.SessionFactory sessionFactory,
BootstrapManager bootstrapManager)
Deprecated.
since 7.20.0. Use
isColumnPresent(String, String, PlatformTransactionManager, org.hibernate.SessionFactory, BootstrapManager) instead. |
static boolean |
isColumnPresent(String tableName,
String columnName,
org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory,
BootstrapManager bootstrapManager)
Get whether a column is present in the database.
|
static boolean |
isTablePresent(String tableName,
org.springframework.transaction.PlatformTransactionManager transactionManager,
net.sf.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.20.0. Use
isTablePresent(String, PlatformTransactionManager, org.hibernate.SessionFactory) instead. |
static boolean |
isTablePresent(String tableName,
org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory) |
static <T> T |
runWithNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager,
net.sf.hibernate.SessionFactory sessionFactory,
Function<Connection,T> callback)
Deprecated.
since 7.20.0, Use
runWithNewConnection(PlatformTransactionManager, org.hibernate.SessionFactory, Function) instead. |
static <T> T |
runWithNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory,
Function<Connection,T> callback) |
static <T> T |
withNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager,
net.sf.hibernate.SessionFactory sessionFactory,
com.google.common.base.Function<Connection,T> callback)
Deprecated.
since 7.0.1. Use
runWithNewConnection(PlatformTransactionManager, org.hibernate.SessionFactory, Function) instead. |
static <T> T |
withNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory,
com.google.common.base.Function<Connection,T> callback)
Deprecated.
since 7.0.1. Use
runWithNewConnection(PlatformTransactionManager, org.hibernate.SessionFactory, Function) instead. |
@Deprecated public static org.hibernate.Session getSession(org.hibernate.SessionFactory sessionFactory)
@Deprecated public static net.sf.hibernate.Session getSession(net.sf.hibernate.SessionFactory sessionFactory)
@Deprecated public static void flush(net.sf.hibernate.Session session) throws org.springframework.dao.DataAccessException
This does not commit anything by itself, but relies on the surrounding transaction to commit the changes.
org.springframework.dao.DataAccessException - if the connection cannot be retrieved@Deprecated public static void flushAndClear(net.sf.hibernate.Session session) throws org.springframework.dao.DataAccessException
This does not commit anything by itself, but relies on the surrounding transaction to commit or roll back the changes.
Use this method if you are processing a large number of Hibernate objects and want to make sure that ones which are already processed are not kept in memory.
org.springframework.dao.DataAccessException - if the connection cannot be retrieved@Deprecated public static org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate(net.sf.hibernate.Session session)
DataAccessUtils.getJdbcTemplate(org.hibernate.Session) instead.@Deprecated public static org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate(org.hibernate.Session session)
DataAccessUtils.getJdbcTemplate(org.hibernate.Session) instead.@Deprecated public static org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate(net.sf.hibernate.SessionFactory sessionFactory)
DataAccessUtils.getJdbcTemplate(org.hibernate.Session) instead.@Deprecated public static org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate(org.hibernate.SessionFactory sessionFactory)
getJdbcTemplate(Session)@Deprecated public static Connection getConnection(net.sf.hibernate.Session session) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException - if the connection cannot be retrieved@Deprecated public static Connection getConnection(org.hibernate.Session session)
@Deprecated public static net.sf.hibernate.dialect.Dialect getDialect() throws org.springframework.dao.DataAccessException
DataAccessUtils.getDialect() instead.org.springframework.dao.DataAccessException@Deprecated public static net.sf.hibernate.dialect.Dialect getDialect(ConfluenceHibernateConfig hibernateConfig) throws org.springframework.dao.DataAccessException
com.atlassian.confluence.impl.hibernate.DataAccessUtils#getDialect(ConfluenceHibernateConfig) instead.org.springframework.dao.DataAccessException@Deprecated public static net.sf.hibernate.dialect.Dialect getDialect(com.atlassian.config.db.HibernateConfig hibernateConfig) throws org.springframework.dao.DataAccessException
DataAccessUtils.getDialect(com.atlassian.config.db.HibernateConfig) instead.org.springframework.dao.DataAccessException@Deprecated public static org.hibernate.dialect.Dialect getDialectV5() throws org.springframework.dao.DataAccessException
DataAccessUtils.getDialect() instead.org.springframework.dao.DataAccessException@Deprecated public static org.hibernate.dialect.Dialect getDialectV5(ConfluenceHibernateConfig hibernateConfig) throws org.springframework.dao.DataAccessException
DataAccessUtils.getDialect(com.atlassian.config.db.HibernateConfig) instead.hibernateConfig - org.springframework.dao.DataAccessException@Deprecated public static Set<String> filterToExistingTables(Set<String> tableNames, org.springframework.transaction.PlatformTransactionManager transactionManager, net.sf.hibernate.SessionFactory sessionFactory)
filterToExistingTables(Set, PlatformTransactionManager, org.hibernate.SessionFactory) instead.tableNames - transactionManager - public static Set<String> filterToExistingTables(Set<String> tableNames, org.springframework.transaction.PlatformTransactionManager transactionManager, org.hibernate.SessionFactory sessionFactory)
@Deprecated public static boolean isTablePresent(String tableName, org.springframework.transaction.PlatformTransactionManager transactionManager, net.sf.hibernate.SessionFactory sessionFactory)
isTablePresent(String, PlatformTransactionManager, org.hibernate.SessionFactory) instead.tableName - transactionManager - sessionFactory - public static boolean isTablePresent(String tableName, org.springframework.transaction.PlatformTransactionManager transactionManager, org.hibernate.SessionFactory sessionFactory)
@Deprecated public static String getPrimaryKeyColumnName(org.springframework.transaction.PlatformTransactionManager transactionManager, net.sf.hibernate.SessionFactory sessionFactory, String tableName)
getPrimaryKeyColumnName(PlatformTransactionManager, org.hibernate.SessionFactory, String) instead.IllegalStateException - if there is no primary key on the given table, or if the primary is
constructed from more than one columnpublic static String getPrimaryKeyColumnName(org.springframework.transaction.PlatformTransactionManager transactionManager, org.hibernate.SessionFactory sessionFactory, String tableName)
IllegalStateException - if there is no primary key on the given table, or if the primary is
constructed from more than one column@Deprecated public static boolean isColumnPresent(String tableName, String columnName, org.springframework.transaction.PlatformTransactionManager transactionManager, net.sf.hibernate.SessionFactory sessionFactory, BootstrapManager bootstrapManager) throws com.atlassian.core.exception.InfrastructureException
isColumnPresent(String, String, PlatformTransactionManager, org.hibernate.SessionFactory, BootstrapManager) instead.com.atlassian.core.exception.InfrastructureExceptionpublic static boolean isColumnPresent(String tableName, String columnName, org.springframework.transaction.PlatformTransactionManager transactionManager, org.hibernate.SessionFactory sessionFactory, BootstrapManager bootstrapManager) throws com.atlassian.core.exception.InfrastructureException
com.atlassian.core.exception.InfrastructureException@Deprecated public static <T> T withNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager, net.sf.hibernate.SessionFactory sessionFactory, com.google.common.base.Function<Connection,T> callback)
runWithNewConnection(PlatformTransactionManager, org.hibernate.SessionFactory, Function) instead.@Deprecated public static <T> T runWithNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager, net.sf.hibernate.SessionFactory sessionFactory, Function<Connection,T> callback)
runWithNewConnection(PlatformTransactionManager, org.hibernate.SessionFactory, Function) instead.@Deprecated public static <T> T withNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager, org.hibernate.SessionFactory sessionFactory, com.google.common.base.Function<Connection,T> callback)
runWithNewConnection(PlatformTransactionManager, org.hibernate.SessionFactory, Function) instead.public static <T> T runWithNewConnection(org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory,
Function<Connection,T> callback)
public static org.hibernate.tool.schema.extract.spi.DatabaseInformation getDatabaseInformation(Connection connection, org.hibernate.SessionFactory sessionFactory) throws org.hibernate.JDBCException, SQLException
DatabaseInformation from Hibernate 5 to access database meta information as a replacement of DatabaseMetadata from Hibernate 2org.hibernate.JDBCExceptionSQLExceptionCopyright © 2003–2022 Atlassian. All rights reserved.