提交 e9094222 编写于 作者: J Juergen Hoeller

Deprecate Hibernate 3 support

Issue: SPR-13230
上级 a2a9c47e
...@@ -49,7 +49,9 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -49,7 +49,9 @@ import org.springframework.beans.factory.InitializingBean;
* @see #setExposeTransactionAwareSessionFactory * @see #setExposeTransactionAwareSessionFactory
* @see org.hibernate.SessionFactory#getCurrentSession() * @see org.hibernate.SessionFactory#getCurrentSession()
* @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor * @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public abstract class AbstractSessionFactoryBean extends HibernateExceptionTranslator public abstract class AbstractSessionFactoryBean extends HibernateExceptionTranslator
implements FactoryBean<SessionFactory>, InitializingBean, DisposableBean { implements FactoryBean<SessionFactory>, InitializingBean, DisposableBean {
......
...@@ -61,7 +61,9 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -61,7 +61,9 @@ import org.springframework.beans.factory.InitializingBean;
* @since 1.2 * @since 1.2
* @see org.hibernate.engine.FilterDefinition * @see org.hibernate.engine.FilterDefinition
* @see LocalSessionFactoryBean#setFilterDefinitions * @see LocalSessionFactoryBean#setFilterDefinitions
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class FilterDefinitionFactoryBean implements FactoryBean<FilterDefinition>, BeanNameAware, InitializingBean { public class FilterDefinitionFactoryBean implements FactoryBean<FilterDefinition>, BeanNameAware, InitializingBean {
private final TypeResolver typeResolver = new TypeResolver(); private final TypeResolver typeResolver = new TypeResolver();
......
...@@ -48,7 +48,9 @@ import org.springframework.jdbc.support.SQLExceptionTranslator; ...@@ -48,7 +48,9 @@ import org.springframework.jdbc.support.SQLExceptionTranslator;
* @see HibernateTemplate * @see HibernateTemplate
* @see HibernateInterceptor * @see HibernateInterceptor
* @see #setFlushMode * @see #setFlushMode
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public abstract class HibernateAccessor implements InitializingBean, BeanFactoryAware { public abstract class HibernateAccessor implements InitializingBean, BeanFactoryAware {
/** /**
......
...@@ -40,7 +40,9 @@ import org.hibernate.Session; ...@@ -40,7 +40,9 @@ import org.hibernate.Session;
* @since 1.2 * @since 1.2
* @see HibernateTemplate * @see HibernateTemplate
* @see HibernateTransactionManager * @see HibernateTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public interface HibernateCallback<T> { public interface HibernateCallback<T> {
/** /**
......
...@@ -39,7 +39,9 @@ import org.springframework.jdbc.support.SQLExceptionTranslator; ...@@ -39,7 +39,9 @@ import org.springframework.jdbc.support.SQLExceptionTranslator;
* @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor * @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
* @see SessionFactoryUtils#convertHibernateAccessException(HibernateException) * @see SessionFactoryUtils#convertHibernateAccessException(HibernateException)
* @see SQLExceptionTranslator * @see SQLExceptionTranslator
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class HibernateExceptionTranslator implements PersistenceExceptionTranslator { public class HibernateExceptionTranslator implements PersistenceExceptionTranslator {
private SQLExceptionTranslator jdbcExceptionTranslator; private SQLExceptionTranslator jdbcExceptionTranslator;
......
...@@ -29,7 +29,9 @@ import org.springframework.dao.UncategorizedDataAccessException; ...@@ -29,7 +29,9 @@ import org.springframework.dao.UncategorizedDataAccessException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException * @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HibernateJdbcException extends UncategorizedDataAccessException { public class HibernateJdbcException extends UncategorizedDataAccessException {
......
...@@ -28,7 +28,9 @@ import org.springframework.orm.ObjectRetrievalFailureException; ...@@ -28,7 +28,9 @@ import org.springframework.orm.ObjectRetrievalFailureException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException * @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HibernateObjectRetrievalFailureException extends ObjectRetrievalFailureException { public class HibernateObjectRetrievalFailureException extends ObjectRetrievalFailureException {
......
...@@ -62,7 +62,9 @@ import org.springframework.dao.DataAccessException; ...@@ -62,7 +62,9 @@ import org.springframework.dao.DataAccessException;
* @see org.springframework.transaction.jta.JtaTransactionManager * @see org.springframework.transaction.jta.JtaTransactionManager
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewFilter * @see org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor * @see org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public interface HibernateOperations { public interface HibernateOperations {
/** /**
......
...@@ -30,7 +30,9 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException; ...@@ -30,7 +30,9 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException * @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HibernateOptimisticLockingFailureException extends ObjectOptimisticLockingFailureException { public class HibernateOptimisticLockingFailureException extends ObjectOptimisticLockingFailureException {
......
...@@ -27,7 +27,9 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException; ...@@ -27,7 +27,9 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException * @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HibernateQueryException extends InvalidDataAccessResourceUsageException { public class HibernateQueryException extends InvalidDataAccessResourceUsageException {
......
...@@ -28,7 +28,9 @@ import org.springframework.dao.UncategorizedDataAccessException; ...@@ -28,7 +28,9 @@ import org.springframework.dao.UncategorizedDataAccessException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException * @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HibernateSystemException extends UncategorizedDataAccessException { public class HibernateSystemException extends UncategorizedDataAccessException {
......
...@@ -104,7 +104,9 @@ import org.springframework.util.Assert; ...@@ -104,7 +104,9 @@ import org.springframework.util.Assert;
* @see org.springframework.transaction.jta.JtaTransactionManager * @see org.springframework.transaction.jta.JtaTransactionManager
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewFilter * @see org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor * @see org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class HibernateTemplate extends HibernateAccessor implements HibernateOperations { public class HibernateTemplate extends HibernateAccessor implements HibernateOperations {
......
...@@ -128,7 +128,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager ...@@ -128,7 +128,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* @see org.springframework.jdbc.core.JdbcTemplate * @see org.springframework.jdbc.core.JdbcTemplate
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager * @see org.springframework.jdbc.datasource.DataSourceTransactionManager
* @see org.springframework.transaction.jta.JtaTransactionManager * @see org.springframework.transaction.jta.JtaTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HibernateTransactionManager extends AbstractPlatformTransactionManager public class HibernateTransactionManager extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, BeanFactoryAware, InitializingBean { implements ResourceTransactionManager, BeanFactoryAware, InitializingBean {
......
...@@ -36,7 +36,9 @@ import org.springframework.jdbc.datasource.DataSourceUtils; ...@@ -36,7 +36,9 @@ import org.springframework.jdbc.datasource.DataSourceUtils;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see LocalSessionFactoryBean#setDataSource * @see LocalSessionFactoryBean#setDataSource
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LocalDataSourceConnectionProvider implements ConnectionProvider { public class LocalDataSourceConnectionProvider implements ConnectionProvider {
private DataSource dataSource; private DataSource dataSource;
......
...@@ -23,7 +23,9 @@ package org.springframework.orm.hibernate3; ...@@ -23,7 +23,9 @@ package org.springframework.orm.hibernate3;
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.5.1 * @since 2.5.1
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LocalJtaDataSourceConnectionProvider extends LocalDataSourceConnectionProvider { public class LocalJtaDataSourceConnectionProvider extends LocalDataSourceConnectionProvider {
/** /**
......
...@@ -36,7 +36,9 @@ import org.hibernate.cfg.Settings; ...@@ -36,7 +36,9 @@ import org.hibernate.cfg.Settings;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 3.0 * @since 3.0
* @see LocalSessionFactoryBean#setCacheRegionFactory * @see LocalSessionFactoryBean#setCacheRegionFactory
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LocalRegionFactoryProxy implements RegionFactory { public class LocalRegionFactoryProxy implements RegionFactory {
private final RegionFactory regionFactory; private final RegionFactory regionFactory;
......
...@@ -102,7 +102,9 @@ import org.springframework.util.StringUtils; ...@@ -102,7 +102,9 @@ import org.springframework.util.StringUtils;
* @see #setJtaTransactionManager * @see #setJtaTransactionManager
* @see org.hibernate.SessionFactory#getCurrentSession() * @see org.hibernate.SessionFactory#getCurrentSession()
* @see HibernateTransactionManager * @see HibernateTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implements BeanClassLoaderAware { public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implements BeanClassLoaderAware {
private static final ThreadLocal<DataSource> configTimeDataSourceHolder = private static final ThreadLocal<DataSource> configTimeDataSourceHolder =
......
...@@ -41,7 +41,9 @@ import org.hibernate.transaction.TransactionManagerLookup; ...@@ -41,7 +41,9 @@ import org.hibernate.transaction.TransactionManagerLookup;
* @since 1.2 * @since 1.2
* @see LocalSessionFactoryBean#setJtaTransactionManager * @see LocalSessionFactoryBean#setJtaTransactionManager
* @see org.springframework.transaction.jta.JtaTransactionManager#setTransactionManager * @see org.springframework.transaction.jta.JtaTransactionManager#setTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LocalTransactionManagerLookup implements TransactionManagerLookup { public class LocalTransactionManagerLookup implements TransactionManagerLookup {
private final TransactionManager transactionManager; private final TransactionManager transactionManager;
......
...@@ -100,7 +100,9 @@ import org.springframework.util.Assert; ...@@ -100,7 +100,9 @@ import org.springframework.util.Assert;
* @see HibernateTransactionManager * @see HibernateTransactionManager
* @see org.springframework.transaction.jta.JtaTransactionManager * @see org.springframework.transaction.jta.JtaTransactionManager
* @see org.springframework.transaction.support.TransactionSynchronizationManager * @see org.springframework.transaction.support.TransactionSynchronizationManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public abstract class SessionFactoryUtils { public abstract class SessionFactoryUtils {
/** /**
......
...@@ -37,7 +37,9 @@ import org.springframework.util.Assert; ...@@ -37,7 +37,9 @@ import org.springframework.util.Assert;
* @since 1.2 * @since 1.2
* @see HibernateTransactionManager * @see HibernateTransactionManager
* @see SessionFactoryUtils * @see SessionFactoryUtils
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class SessionHolder extends ResourceHolderSupport { public class SessionHolder extends ResourceHolderSupport {
private static final Object DEFAULT_KEY = new Object(); private static final Object DEFAULT_KEY = new Object();
......
...@@ -37,7 +37,9 @@ import org.hibernate.engine.SessionFactoryImplementor; ...@@ -37,7 +37,9 @@ import org.hibernate.engine.SessionFactoryImplementor;
* @since 2.0 * @since 2.0
* @see SessionFactoryUtils#doGetSession * @see SessionFactoryUtils#doGetSession
* @see LocalSessionFactoryBean#setExposeTransactionAwareSessionFactory * @see LocalSessionFactoryBean#setExposeTransactionAwareSessionFactory
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class SpringSessionContext implements CurrentSessionContext { public class SpringSessionContext implements CurrentSessionContext {
......
...@@ -42,7 +42,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager ...@@ -42,7 +42,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* @since 1.2 * @since 1.2
* @see SessionFactoryUtils * @see SessionFactoryUtils
* @see org.springframework.transaction.jta.JtaTransactionManager * @see org.springframework.transaction.jta.JtaTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
class SpringSessionSynchronization implements TransactionSynchronization, Ordered { class SpringSessionSynchronization implements TransactionSynchronization, Ordered {
private final SessionHolder sessionHolder; private final SessionHolder sessionHolder;
......
...@@ -36,7 +36,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager ...@@ -36,7 +36,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* @since 2.5.4 * @since 2.5.4
* @see org.springframework.transaction.support.TransactionSynchronizationManager * @see org.springframework.transaction.support.TransactionSynchronizationManager
* @see org.hibernate.transaction.JDBCTransactionFactory * @see org.hibernate.transaction.JDBCTransactionFactory
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class SpringTransactionFactory implements TransactionFactory { public class SpringTransactionFactory implements TransactionFactory {
/** /**
......
...@@ -28,7 +28,9 @@ import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy; ...@@ -28,7 +28,9 @@ import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see LocalSessionFactoryBean#setUseTransactionAwareDataSource * @see LocalSessionFactoryBean#setUseTransactionAwareDataSource
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class TransactionAwareDataSourceConnectionProvider extends LocalDataSourceConnectionProvider { public class TransactionAwareDataSourceConnectionProvider extends LocalDataSourceConnectionProvider {
/** /**
......
...@@ -48,7 +48,9 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -48,7 +48,9 @@ import org.springframework.beans.factory.InitializingBean;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see LocalSessionFactoryBean#setTypeDefinitions(TypeDefinitionBean[]) * @see LocalSessionFactoryBean#setTypeDefinitions(TypeDefinitionBean[])
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class TypeDefinitionBean implements BeanNameAware, InitializingBean { public class TypeDefinitionBean implements BeanNameAware, InitializingBean {
private String typeName; private String typeName;
......
...@@ -38,7 +38,6 @@ import org.springframework.core.type.classreading.MetadataReader; ...@@ -38,7 +38,6 @@ import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory; import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.AnnotationTypeFilter; import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.core.type.filter.TypeFilter; import org.springframework.core.type.filter.TypeFilter;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
/** /**
...@@ -74,8 +73,11 @@ import org.springframework.util.ClassUtils; ...@@ -74,8 +73,11 @@ import org.springframework.util.ClassUtils;
* @see #setHibernateProperties * @see #setHibernateProperties
* @see #setAnnotatedClasses * @see #setAnnotatedClasses
* @see #setAnnotatedPackages * @see #setAnnotatedPackages
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
public class AnnotationSessionFactoryBean extends LocalSessionFactoryBean implements ResourceLoaderAware { @Deprecated
public class AnnotationSessionFactoryBean extends org.springframework.orm.hibernate3.LocalSessionFactoryBean
implements ResourceLoaderAware {
private static final String RESOURCE_PATTERN = "/**/*.class"; private static final String RESOURCE_PATTERN = "/**/*.class";
......
...@@ -32,7 +32,6 @@ import org.hibernate.util.EqualsHelper; ...@@ -32,7 +32,6 @@ import org.hibernate.util.EqualsHelper;
import org.springframework.jdbc.support.lob.LobCreator; import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobCreatorUtils; import org.springframework.jdbc.support.lob.LobCreatorUtils;
import org.springframework.jdbc.support.lob.LobHandler; import org.springframework.jdbc.support.lob.LobHandler;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
/** /**
* Abstract base class for Hibernate UserType implementations that map to LOBs. * Abstract base class for Hibernate UserType implementations that map to LOBs.
...@@ -52,7 +51,9 @@ import org.springframework.orm.hibernate3.LocalSessionFactoryBean; ...@@ -52,7 +51,9 @@ import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
* @see org.springframework.jdbc.support.lob.LobCreator * @see org.springframework.jdbc.support.lob.LobCreator
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setJtaTransactionManager * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setJtaTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public abstract class AbstractLobType implements UserType { public abstract class AbstractLobType implements UserType {
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
...@@ -69,8 +70,8 @@ public abstract class AbstractLobType implements UserType { ...@@ -69,8 +70,8 @@ public abstract class AbstractLobType implements UserType {
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#getConfigTimeTransactionManager * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#getConfigTimeTransactionManager
*/ */
protected AbstractLobType() { protected AbstractLobType() {
this(LocalSessionFactoryBean.getConfigTimeLobHandler(), this(org.springframework.orm.hibernate3.LocalSessionFactoryBean.getConfigTimeLobHandler(),
LocalSessionFactoryBean.getConfigTimeTransactionManager()); org.springframework.orm.hibernate3.LocalSessionFactoryBean.getConfigTimeTransactionManager());
} }
/** /**
......
...@@ -22,8 +22,6 @@ import org.apache.commons.logging.Log; ...@@ -22,8 +22,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
import org.springframework.orm.hibernate3.SessionHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter; import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter;
...@@ -40,19 +38,21 @@ import org.springframework.web.context.request.async.DeferredResultProcessingInt ...@@ -40,19 +38,21 @@ import org.springframework.web.context.request.async.DeferredResultProcessingInt
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 3.2.5 * @since 3.2.5
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
class AsyncRequestInterceptor extends CallableProcessingInterceptorAdapter implements DeferredResultProcessingInterceptor { class AsyncRequestInterceptor extends CallableProcessingInterceptorAdapter implements DeferredResultProcessingInterceptor {
private static final Log logger = LogFactory.getLog(AsyncRequestInterceptor.class); private static final Log logger = LogFactory.getLog(AsyncRequestInterceptor.class);
private final SessionFactory sessionFactory; private final SessionFactory sessionFactory;
private final SessionHolder sessionHolder; private final org.springframework.orm.hibernate3.SessionHolder sessionHolder;
private volatile boolean timeoutInProgress; private volatile boolean timeoutInProgress;
public AsyncRequestInterceptor(SessionFactory sessionFactory, SessionHolder sessionHolder) { public AsyncRequestInterceptor(SessionFactory sessionFactory, org.springframework.orm.hibernate3.SessionHolder sessionHolder) {
this.sessionFactory = sessionFactory; this.sessionFactory = sessionFactory;
this.sessionHolder = sessionHolder; this.sessionHolder = sessionHolder;
} }
...@@ -87,7 +87,7 @@ class AsyncRequestInterceptor extends CallableProcessingInterceptorAdapter imple ...@@ -87,7 +87,7 @@ class AsyncRequestInterceptor extends CallableProcessingInterceptorAdapter imple
private void closeAfterTimeout() { private void closeAfterTimeout() {
if (this.timeoutInProgress) { if (this.timeoutInProgress) {
logger.debug("Closing Hibernate Session after async request timeout"); logger.debug("Closing Hibernate Session after async request timeout");
SessionFactoryUtils.closeSession(this.sessionHolder.getSession()); org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(this.sessionHolder.getSession());
} }
} }
......
...@@ -38,7 +38,9 @@ import org.springframework.jdbc.support.lob.LobHandler; ...@@ -38,7 +38,9 @@ import org.springframework.jdbc.support.lob.LobHandler;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class BlobByteArrayType extends AbstractLobType { public class BlobByteArrayType extends AbstractLobType {
/** /**
......
...@@ -46,7 +46,9 @@ import org.springframework.jdbc.support.lob.LobHandler; ...@@ -46,7 +46,9 @@ import org.springframework.jdbc.support.lob.LobHandler;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class BlobSerializableType extends AbstractLobType { public class BlobSerializableType extends AbstractLobType {
/** /**
......
...@@ -44,7 +44,9 @@ import org.springframework.jdbc.support.lob.LobHandler; ...@@ -44,7 +44,9 @@ import org.springframework.jdbc.support.lob.LobHandler;
* @since 1.2.7 * @since 1.2.7
* @see #getCharacterEncoding() * @see #getCharacterEncoding()
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class BlobStringType extends AbstractLobType { public class BlobStringType extends AbstractLobType {
/** /**
......
...@@ -40,7 +40,9 @@ import org.springframework.jdbc.support.lob.LobHandler; ...@@ -40,7 +40,9 @@ import org.springframework.jdbc.support.lob.LobHandler;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class ClobStringType extends AbstractLobType { public class ClobStringType extends AbstractLobType {
/** /**
......
...@@ -23,8 +23,6 @@ import org.hibernate.SessionFactory; ...@@ -23,8 +23,6 @@ import org.hibernate.SessionFactory;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.dao.support.DaoSupport; import org.springframework.dao.support.DaoSupport;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
/** /**
* Convenient super class for Hibernate-based data access objects. * Convenient super class for Hibernate-based data access objects.
...@@ -56,10 +54,12 @@ import org.springframework.orm.hibernate3.SessionFactoryUtils; ...@@ -56,10 +54,12 @@ import org.springframework.orm.hibernate3.SessionFactoryUtils;
* @see #setSessionFactory * @see #setSessionFactory
* @see #getHibernateTemplate * @see #getHibernateTemplate
* @see org.springframework.orm.hibernate3.HibernateTemplate * @see org.springframework.orm.hibernate3.HibernateTemplate
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public abstract class HibernateDaoSupport extends DaoSupport { public abstract class HibernateDaoSupport extends DaoSupport {
private HibernateTemplate hibernateTemplate; private org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate;
/** /**
...@@ -83,8 +83,8 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -83,8 +83,8 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* @return the new HibernateTemplate instance * @return the new HibernateTemplate instance
* @see #setSessionFactory * @see #setSessionFactory
*/ */
protected HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) { protected org.springframework.orm.hibernate3.HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) {
return new HibernateTemplate(sessionFactory); return new org.springframework.orm.hibernate3.HibernateTemplate(sessionFactory);
} }
/** /**
...@@ -99,7 +99,7 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -99,7 +99,7 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* as an alternative to specifying a SessionFactory. * as an alternative to specifying a SessionFactory.
* @see #setSessionFactory * @see #setSessionFactory
*/ */
public final void setHibernateTemplate(HibernateTemplate hibernateTemplate) { public final void setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate) {
this.hibernateTemplate = hibernateTemplate; this.hibernateTemplate = hibernateTemplate;
} }
...@@ -113,7 +113,7 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -113,7 +113,7 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* {@code new HibernateTemplate(getSessionFactory())}, in which case * {@code new HibernateTemplate(getSessionFactory())}, in which case
* you're allowed to customize the settings on the resulting instance. * you're allowed to customize the settings on the resulting instance.
*/ */
public final HibernateTemplate getHibernateTemplate() { public final org.springframework.orm.hibernate3.HibernateTemplate getHibernateTemplate() {
return this.hibernateTemplate; return this.hibernateTemplate;
} }
...@@ -141,7 +141,7 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -141,7 +141,7 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* @throws DataAccessResourceFailureException if the Session couldn't be created * @throws DataAccessResourceFailureException if the Session couldn't be created
* @throws IllegalStateException if no thread-bound Session found and allowCreate=false * @throws IllegalStateException if no thread-bound Session found and allowCreate=false
* @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession(SessionFactory, boolean) * @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession(SessionFactory, boolean)
* @deprecated as of Spring 3.2.7, in favor of {@link HibernateTemplate} usage * @deprecated as of Spring 3.2.7, in favor of {@link org.springframework.orm.hibernate3.HibernateTemplate} usage
*/ */
@Deprecated @Deprecated
protected final Session getSession() throws DataAccessResourceFailureException, IllegalStateException { protected final Session getSession() throws DataAccessResourceFailureException, IllegalStateException {
...@@ -166,15 +166,15 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -166,15 +166,15 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* @throws DataAccessResourceFailureException if the Session couldn't be created * @throws DataAccessResourceFailureException if the Session couldn't be created
* @throws IllegalStateException if no thread-bound Session found and allowCreate=false * @throws IllegalStateException if no thread-bound Session found and allowCreate=false
* @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession(SessionFactory, boolean) * @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession(SessionFactory, boolean)
* @deprecated as of Spring 3.2.7, in favor of {@link HibernateTemplate} usage * @deprecated as of Spring 3.2.7, in favor of {@link org.springframework.orm.hibernate3.HibernateTemplate} usage
*/ */
@Deprecated @Deprecated
protected final Session getSession(boolean allowCreate) protected final Session getSession(boolean allowCreate)
throws DataAccessResourceFailureException, IllegalStateException { throws DataAccessResourceFailureException, IllegalStateException {
return (!allowCreate ? return (!allowCreate ?
SessionFactoryUtils.getSession(getSessionFactory(), false) : org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(getSessionFactory(), false) :
SessionFactoryUtils.getSession( org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(
getSessionFactory(), getSessionFactory(),
this.hibernateTemplate.getEntityInterceptor(), this.hibernateTemplate.getEntityInterceptor(),
this.hibernateTemplate.getJdbcExceptionTranslator())); this.hibernateTemplate.getJdbcExceptionTranslator()));
...@@ -192,7 +192,7 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -192,7 +192,7 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* @param ex HibernateException that occurred * @param ex HibernateException that occurred
* @return the corresponding DataAccessException instance * @return the corresponding DataAccessException instance
* @see org.springframework.orm.hibernate3.SessionFactoryUtils#convertHibernateAccessException * @see org.springframework.orm.hibernate3.SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 3.2.7, in favor of {@link HibernateTemplate} usage * @deprecated as of Spring 3.2.7, in favor of {@link org.springframework.orm.hibernate3.HibernateTemplate} usage
*/ */
@Deprecated @Deprecated
protected final DataAccessException convertHibernateAccessException(HibernateException ex) { protected final DataAccessException convertHibernateAccessException(HibernateException ex) {
...@@ -206,11 +206,11 @@ public abstract class HibernateDaoSupport extends DaoSupport { ...@@ -206,11 +206,11 @@ public abstract class HibernateDaoSupport extends DaoSupport {
* {@link #getSession} and {@link #convertHibernateAccessException}. * {@link #getSession} and {@link #convertHibernateAccessException}.
* @param session the Session to close * @param session the Session to close
* @see org.springframework.orm.hibernate3.SessionFactoryUtils#releaseSession * @see org.springframework.orm.hibernate3.SessionFactoryUtils#releaseSession
* @deprecated as of Spring 3.2.7, in favor of {@link HibernateTemplate} usage * @deprecated as of Spring 3.2.7, in favor of {@link org.springframework.orm.hibernate3.HibernateTemplate} usage
*/ */
@Deprecated @Deprecated
protected final void releaseSession(Session session) { protected final void releaseSession(Session session) {
SessionFactoryUtils.releaseSession(session, getSessionFactory()); org.springframework.orm.hibernate3.SessionFactoryUtils.releaseSession(session, getSessionFactory());
} }
} }
...@@ -48,7 +48,9 @@ import org.hibernate.persister.entity.EntityPersister; ...@@ -48,7 +48,9 @@ import org.hibernate.persister.entity.EntityPersister;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.2 * @since 1.2
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setEventListeners(java.util.Map) * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setEventListeners(java.util.Map)
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings({"serial", "rawtypes", "deprecation"}) @SuppressWarnings({"serial", "rawtypes", "deprecation"})
public class IdTransferringMergeEventListener extends DefaultMergeEventListener { public class IdTransferringMergeEventListener extends DefaultMergeEventListener {
......
...@@ -27,8 +27,6 @@ import org.hibernate.Session; ...@@ -27,8 +27,6 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
import org.springframework.orm.hibernate3.SessionHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
...@@ -91,7 +89,9 @@ import org.springframework.web.filter.OncePerRequestFilter; ...@@ -91,7 +89,9 @@ import org.springframework.web.filter.OncePerRequestFilter;
* @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession * @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession
* @see org.springframework.transaction.support.TransactionSynchronizationManager * @see org.springframework.transaction.support.TransactionSynchronizationManager
* @see org.hibernate.SessionFactory#getCurrentSession() * @see org.hibernate.SessionFactory#getCurrentSession()
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class OpenSessionInViewFilter extends OncePerRequestFilter { public class OpenSessionInViewFilter extends OncePerRequestFilter {
public static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory"; public static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory";
...@@ -127,8 +127,8 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -127,8 +127,8 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
* its own session (like without Open Session in View). Each of those * its own session (like without Open Session in View). Each of those
* sessions will be registered for deferred close, though, actually * sessions will be registered for deferred close, though, actually
* processed at request completion. * processed at request completion.
* @see SessionFactoryUtils#initDeferredClose * @see org.springframework.orm.hibernate3.SessionFactoryUtils#initDeferredClose
* @see SessionFactoryUtils#processDeferredClose * @see org.springframework.orm.hibernate3.SessionFactoryUtils#processDeferredClose
*/ */
public void setSingleSession(boolean singleSession) { public void setSingleSession(boolean singleSession) {
this.singleSession = singleSession; this.singleSession = singleSession;
...@@ -206,7 +206,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -206,7 +206,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
if (isFirstRequest || !applySessionBindingInterceptor(asyncManager, key)) { if (isFirstRequest || !applySessionBindingInterceptor(asyncManager, key)) {
logger.debug("Opening single Hibernate Session in OpenSessionInViewFilter"); logger.debug("Opening single Hibernate Session in OpenSessionInViewFilter");
Session session = getSession(sessionFactory); Session session = getSession(sessionFactory);
SessionHolder sessionHolder = new SessionHolder(session); org.springframework.orm.hibernate3.SessionHolder sessionHolder = new org.springframework.orm.hibernate3.SessionHolder(session);
TransactionSynchronizationManager.bindResource(sessionFactory, sessionHolder); TransactionSynchronizationManager.bindResource(sessionFactory, sessionHolder);
AsyncRequestInterceptor interceptor = new AsyncRequestInterceptor(sessionFactory, sessionHolder); AsyncRequestInterceptor interceptor = new AsyncRequestInterceptor(sessionFactory, sessionHolder);
...@@ -218,12 +218,12 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -218,12 +218,12 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
else { else {
// deferred close mode // deferred close mode
Assert.state(!isAsyncStarted(request), "Deferred close mode is not supported on async dispatches"); Assert.state(!isAsyncStarted(request), "Deferred close mode is not supported on async dispatches");
if (SessionFactoryUtils.isDeferredCloseActive(sessionFactory)) { if (org.springframework.orm.hibernate3.SessionFactoryUtils.isDeferredCloseActive(sessionFactory)) {
// Do not modify deferred close: just set the participate flag. // Do not modify deferred close: just set the participate flag.
participate = true; participate = true;
} }
else { else {
SessionFactoryUtils.initDeferredClose(sessionFactory); org.springframework.orm.hibernate3.SessionFactoryUtils.initDeferredClose(sessionFactory);
} }
} }
...@@ -234,8 +234,8 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -234,8 +234,8 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
if (!participate) { if (!participate) {
if (isSingleSession()) { if (isSingleSession()) {
// single session mode // single session mode
SessionHolder sessionHolder = org.springframework.orm.hibernate3.SessionHolder sessionHolder =
(SessionHolder) TransactionSynchronizationManager.unbindResource(sessionFactory); (org.springframework.orm.hibernate3.SessionHolder) TransactionSynchronizationManager.unbindResource(sessionFactory);
if (!isAsyncStarted(request)) { if (!isAsyncStarted(request)) {
logger.debug("Closing single Hibernate Session in OpenSessionInViewFilter"); logger.debug("Closing single Hibernate Session in OpenSessionInViewFilter");
closeSession(sessionHolder.getSession(), sessionFactory); closeSession(sessionHolder.getSession(), sessionFactory);
...@@ -243,7 +243,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -243,7 +243,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
} }
else { else {
// deferred close mode // deferred close mode
SessionFactoryUtils.processDeferredClose(sessionFactory); org.springframework.orm.hibernate3.SessionFactoryUtils.processDeferredClose(sessionFactory);
} }
} }
} }
...@@ -291,7 +291,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -291,7 +291,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
* @see org.hibernate.FlushMode#MANUAL * @see org.hibernate.FlushMode#MANUAL
*/ */
protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException { protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException {
Session session = SessionFactoryUtils.getSession(sessionFactory, true); Session session = org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(sessionFactory, true);
FlushMode flushMode = getFlushMode(); FlushMode flushMode = getFlushMode();
if (flushMode != null) { if (flushMode != null) {
session.setFlushMode(flushMode); session.setFlushMode(flushMode);
...@@ -310,7 +310,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { ...@@ -310,7 +310,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
* @param sessionFactory the SessionFactory that this filter uses * @param sessionFactory the SessionFactory that this filter uses
*/ */
protected void closeSession(Session session, SessionFactory sessionFactory) { protected void closeSession(Session session, SessionFactory sessionFactory) {
SessionFactoryUtils.closeSession(session); org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(session);
} }
private boolean applySessionBindingInterceptor(WebAsyncManager asyncManager, String key) { private boolean applySessionBindingInterceptor(WebAsyncManager asyncManager, String key) {
......
...@@ -20,9 +20,6 @@ import org.hibernate.HibernateException; ...@@ -20,9 +20,6 @@ import org.hibernate.HibernateException;
import org.hibernate.Session; import org.hibernate.Session;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.HibernateAccessor;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
import org.springframework.orm.hibernate3.SessionHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.AsyncWebRequestInterceptor; import org.springframework.web.context.request.AsyncWebRequestInterceptor;
...@@ -91,8 +88,10 @@ import org.springframework.web.context.request.async.WebAsyncUtils; ...@@ -91,8 +88,10 @@ import org.springframework.web.context.request.async.WebAsyncUtils;
* @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession * @see org.springframework.orm.hibernate3.SessionFactoryUtils#getSession
* @see org.springframework.transaction.support.TransactionSynchronizationManager * @see org.springframework.transaction.support.TransactionSynchronizationManager
* @see org.hibernate.SessionFactory#getCurrentSession() * @see org.hibernate.SessionFactory#getCurrentSession()
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
public class OpenSessionInViewInterceptor extends HibernateAccessor implements AsyncWebRequestInterceptor { @Deprecated
public class OpenSessionInViewInterceptor extends org.springframework.orm.hibernate3.HibernateAccessor implements AsyncWebRequestInterceptor {
/** /**
* Suffix that gets appended to the {@code SessionFactory} * Suffix that gets appended to the {@code SessionFactory}
...@@ -121,8 +120,8 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A ...@@ -121,8 +120,8 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
* its own session (like without Open Session in View). Each of those * its own session (like without Open Session in View). Each of those
* sessions will be registered for deferred close, though, actually * sessions will be registered for deferred close, though, actually
* processed at request completion. * processed at request completion.
* @see SessionFactoryUtils#initDeferredClose * @see org.springframework.orm.hibernate3.SessionFactoryUtils#initDeferredClose
* @see SessionFactoryUtils#processDeferredClose * @see org.springframework.orm.hibernate3.SessionFactoryUtils#processDeferredClose
*/ */
public void setSingleSession(boolean singleSession) { public void setSingleSession(boolean singleSession) {
this.singleSession = singleSession; this.singleSession = singleSession;
...@@ -154,7 +153,7 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A ...@@ -154,7 +153,7 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
} }
if ((isSingleSession() && TransactionSynchronizationManager.hasResource(getSessionFactory())) || if ((isSingleSession() && TransactionSynchronizationManager.hasResource(getSessionFactory())) ||
SessionFactoryUtils.isDeferredCloseActive(getSessionFactory())) { org.springframework.orm.hibernate3.SessionFactoryUtils.isDeferredCloseActive(getSessionFactory())) {
// Do not modify the Session: just mark the request accordingly. // Do not modify the Session: just mark the request accordingly.
Integer count = (Integer) request.getAttribute(participateAttributeName, WebRequest.SCOPE_REQUEST); Integer count = (Integer) request.getAttribute(participateAttributeName, WebRequest.SCOPE_REQUEST);
int newCount = (count != null ? count + 1 : 1); int newCount = (count != null ? count + 1 : 1);
...@@ -164,10 +163,10 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A ...@@ -164,10 +163,10 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
if (isSingleSession()) { if (isSingleSession()) {
// single session mode // single session mode
logger.debug("Opening single Hibernate Session in OpenSessionInViewInterceptor"); logger.debug("Opening single Hibernate Session in OpenSessionInViewInterceptor");
Session session = SessionFactoryUtils.getSession( Session session = org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(
getSessionFactory(), getEntityInterceptor(), getJdbcExceptionTranslator()); getSessionFactory(), getEntityInterceptor(), getJdbcExceptionTranslator());
applyFlushMode(session, false); applyFlushMode(session, false);
SessionHolder sessionHolder = new SessionHolder(session); org.springframework.orm.hibernate3.SessionHolder sessionHolder = new org.springframework.orm.hibernate3.SessionHolder(session);
TransactionSynchronizationManager.bindResource(getSessionFactory(), sessionHolder); TransactionSynchronizationManager.bindResource(getSessionFactory(), sessionHolder);
AsyncRequestInterceptor asyncRequestInterceptor = AsyncRequestInterceptor asyncRequestInterceptor =
...@@ -177,7 +176,7 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A ...@@ -177,7 +176,7 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
} }
else { else {
// deferred close mode // deferred close mode
SessionFactoryUtils.initDeferredClose(getSessionFactory()); org.springframework.orm.hibernate3.SessionFactoryUtils.initDeferredClose(getSessionFactory());
} }
} }
} }
...@@ -193,8 +192,8 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A ...@@ -193,8 +192,8 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
public void postHandle(WebRequest request, ModelMap model) throws DataAccessException { public void postHandle(WebRequest request, ModelMap model) throws DataAccessException {
if (isSingleSession()) { if (isSingleSession()) {
// Only potentially flush in single session mode. // Only potentially flush in single session mode.
SessionHolder sessionHolder = org.springframework.orm.hibernate3.SessionHolder sessionHolder =
(SessionHolder) TransactionSynchronizationManager.getResource(getSessionFactory()); (org.springframework.orm.hibernate3.SessionHolder) TransactionSynchronizationManager.getResource(getSessionFactory());
logger.debug("Flushing single Hibernate Session in OpenSessionInViewInterceptor"); logger.debug("Flushing single Hibernate Session in OpenSessionInViewInterceptor");
try { try {
flushIfNecessary(sessionHolder.getSession(), false); flushIfNecessary(sessionHolder.getSession(), false);
...@@ -216,14 +215,14 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A ...@@ -216,14 +215,14 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
if (!decrementParticipateCount(request)) { if (!decrementParticipateCount(request)) {
if (isSingleSession()) { if (isSingleSession()) {
// single session mode // single session mode
SessionHolder sessionHolder = org.springframework.orm.hibernate3.SessionHolder sessionHolder =
(SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory()); (org.springframework.orm.hibernate3.SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
logger.debug("Closing single Hibernate Session in OpenSessionInViewInterceptor"); logger.debug("Closing single Hibernate Session in OpenSessionInViewInterceptor");
SessionFactoryUtils.closeSession(sessionHolder.getSession()); org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(sessionHolder.getSession());
} }
else { else {
// deferred close mode // deferred close mode
SessionFactoryUtils.processDeferredClose(getSessionFactory()); org.springframework.orm.hibernate3.SessionFactoryUtils.processDeferredClose(getSessionFactory());
} }
} }
} }
......
...@@ -25,8 +25,6 @@ import org.hibernate.SessionFactory; ...@@ -25,8 +25,6 @@ import org.hibernate.SessionFactory;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
import org.springframework.orm.hibernate3.SessionHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
/** /**
...@@ -49,7 +47,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager ...@@ -49,7 +47,9 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* @see org.springframework.orm.hibernate3.HibernateTransactionManager * @see org.springframework.orm.hibernate3.HibernateTransactionManager
* @see org.springframework.transaction.support.TransactionSynchronizationManager * @see org.springframework.transaction.support.TransactionSynchronizationManager
* @see org.hibernate.SessionFactory#getCurrentSession() * @see org.hibernate.SessionFactory#getCurrentSession()
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class OpenSessionInterceptor implements MethodInterceptor, InitializingBean { public class OpenSessionInterceptor implements MethodInterceptor, InitializingBean {
private SessionFactory sessionFactory; private SessionFactory sessionFactory;
...@@ -84,11 +84,11 @@ public class OpenSessionInterceptor implements MethodInterceptor, InitializingBe ...@@ -84,11 +84,11 @@ public class OpenSessionInterceptor implements MethodInterceptor, InitializingBe
// New Session to be bound for the current method's scope... // New Session to be bound for the current method's scope...
Session session = openSession(); Session session = openSession();
try { try {
TransactionSynchronizationManager.bindResource(sf, new SessionHolder(session)); TransactionSynchronizationManager.bindResource(sf, new org.springframework.orm.hibernate3.SessionHolder(session));
return invocation.proceed(); return invocation.proceed();
} }
finally { finally {
SessionFactoryUtils.closeSession(session); org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(session);
TransactionSynchronizationManager.unbindResource(sf); TransactionSynchronizationManager.unbindResource(sf);
} }
} }
......
...@@ -41,7 +41,9 @@ import org.springframework.aop.support.AopUtils; ...@@ -41,7 +41,9 @@ import org.springframework.aop.support.AopUtils;
* @author Costin Leau * @author Costin Leau
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class ScopedBeanInterceptor extends EmptyInterceptor { public class ScopedBeanInterceptor extends EmptyInterceptor {
......
...@@ -42,7 +42,9 @@ import static org.mockito.BDDMockito.*; ...@@ -42,7 +42,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class HibernateInterceptorTests { public class HibernateInterceptorTests {
private SessionFactory sessionFactory; private SessionFactory sessionFactory;
......
...@@ -55,7 +55,9 @@ import static org.mockito.BDDMockito.*; ...@@ -55,7 +55,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class HibernateJtaTransactionTests { public class HibernateJtaTransactionTests {
@After @After
......
...@@ -73,8 +73,10 @@ import static org.mockito.BDDMockito.*; ...@@ -73,8 +73,10 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" }) @Deprecated
@SuppressWarnings({"rawtypes", "unchecked"})
public class HibernateTemplateTests { public class HibernateTemplateTests {
private SessionFactory sessionFactory; private SessionFactory sessionFactory;
......
...@@ -65,7 +65,9 @@ import static org.mockito.BDDMockito.*; ...@@ -65,7 +65,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
@SuppressWarnings({"rawtypes", "unchecked", "deprecation"}) @SuppressWarnings({"rawtypes", "unchecked", "deprecation"})
public class HibernateTransactionManagerTests { public class HibernateTransactionManagerTests {
......
...@@ -61,7 +61,9 @@ import static org.mockito.BDDMockito.*; ...@@ -61,7 +61,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LocalSessionFactoryBeanTests { public class LocalSessionFactoryBeanTests {
@Test @Test
......
...@@ -31,7 +31,9 @@ import static org.mockito.BDDMockito.*; ...@@ -31,7 +31,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class HibernateDaoSupportTests { public class HibernateDaoSupportTests {
@Test @Test
......
...@@ -50,7 +50,9 @@ import static org.mockito.BDDMockito.*; ...@@ -50,7 +50,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class LobTypeTests { public class LobTypeTests {
private ResultSet rs = mock(ResultSet.class); private ResultSet rs = mock(ResultSet.class);
......
...@@ -68,7 +68,9 @@ import static org.mockito.BDDMockito.*; ...@@ -68,7 +68,9 @@ import static org.mockito.BDDMockito.*;
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class OpenSessionInViewTests { public class OpenSessionInViewTests {
private MockServletContext sc; private MockServletContext sc;
......
...@@ -27,7 +27,9 @@ import static org.junit.Assert.*; ...@@ -27,7 +27,9 @@ import static org.junit.Assert.*;
* Unit tests for {@link ScopedBeanInterceptor}. * Unit tests for {@link ScopedBeanInterceptor}.
* *
* @author Costin Leau * @author Costin Leau
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/ */
@Deprecated
public class ScopedBeanInterceptorTests { public class ScopedBeanInterceptorTests {
private final ScopedBeanInterceptor interceptor = new ScopedBeanInterceptor(); private final ScopedBeanInterceptor interceptor = new ScopedBeanInterceptor();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册