Skip to content

Commit

Permalink
Deprecate Hibernate 3 support
Browse files Browse the repository at this point in the history
Issue: SPR-13230
  • Loading branch information
jhoeller committed Dec 17, 2015
1 parent a2a9c47 commit e909422
Show file tree
Hide file tree
Showing 47 changed files with 139 additions and 57 deletions.
Expand Up @@ -49,7 +49,9 @@
* @see #setExposeTransactionAwareSessionFactory
* @see org.hibernate.SessionFactory#getCurrentSession()
* @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
implements FactoryBean<SessionFactory>, InitializingBean, DisposableBean {

Expand Down
Expand Up @@ -61,7 +61,9 @@
* @since 1.2
* @see org.hibernate.engine.FilterDefinition
* @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 {

private final TypeResolver typeResolver = new TypeResolver();
Expand Down
Expand Up @@ -48,7 +48,9 @@
* @see HibernateTemplate
* @see HibernateInterceptor
* @see #setFlushMode
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public abstract class HibernateAccessor implements InitializingBean, BeanFactoryAware {

/**
Expand Down
Expand Up @@ -40,7 +40,9 @@
* @since 1.2
* @see HibernateTemplate
* @see HibernateTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public interface HibernateCallback<T> {

/**
Expand Down
Expand Up @@ -39,7 +39,9 @@
* @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
* @see SessionFactoryUtils#convertHibernateAccessException(HibernateException)
* @see SQLExceptionTranslator
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class HibernateExceptionTranslator implements PersistenceExceptionTranslator {

private SQLExceptionTranslator jdbcExceptionTranslator;
Expand Down
Expand Up @@ -29,7 +29,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class HibernateJdbcException extends UncategorizedDataAccessException {

Expand Down
Expand Up @@ -28,7 +28,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class HibernateObjectRetrievalFailureException extends ObjectRetrievalFailureException {

Expand Down
Expand Up @@ -62,7 +62,9 @@
* @see org.springframework.transaction.jta.JtaTransactionManager
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
* @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 {

/**
Expand Down
Expand Up @@ -30,7 +30,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class HibernateOptimisticLockingFailureException extends ObjectOptimisticLockingFailureException {

Expand Down
Expand Up @@ -27,7 +27,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class HibernateQueryException extends InvalidDataAccessResourceUsageException {

Expand Down
Expand Up @@ -28,7 +28,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see SessionFactoryUtils#convertHibernateAccessException
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class HibernateSystemException extends UncategorizedDataAccessException {

Expand Down
Expand Up @@ -104,7 +104,9 @@
* @see org.springframework.transaction.jta.JtaTransactionManager
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
* @see org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("deprecation")
public class HibernateTemplate extends HibernateAccessor implements HibernateOperations {

Expand Down
Expand Up @@ -128,7 +128,9 @@
* @see org.springframework.jdbc.core.JdbcTemplate
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
* @see org.springframework.transaction.jta.JtaTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class HibernateTransactionManager extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, BeanFactoryAware, InitializingBean {
Expand Down
Expand Up @@ -36,7 +36,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see LocalSessionFactoryBean#setDataSource
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class LocalDataSourceConnectionProvider implements ConnectionProvider {

private DataSource dataSource;
Expand Down
Expand Up @@ -23,7 +23,9 @@
*
* @author Juergen Hoeller
* @since 2.5.1
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class LocalJtaDataSourceConnectionProvider extends LocalDataSourceConnectionProvider {

/**
Expand Down
Expand Up @@ -36,7 +36,9 @@
* @author Juergen Hoeller
* @since 3.0
* @see LocalSessionFactoryBean#setCacheRegionFactory
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class LocalRegionFactoryProxy implements RegionFactory {

private final RegionFactory regionFactory;
Expand Down
Expand Up @@ -102,7 +102,9 @@
* @see #setJtaTransactionManager
* @see org.hibernate.SessionFactory#getCurrentSession()
* @see HibernateTransactionManager
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implements BeanClassLoaderAware {

private static final ThreadLocal<DataSource> configTimeDataSourceHolder =
Expand Down
Expand Up @@ -41,7 +41,9 @@
* @since 1.2
* @see LocalSessionFactoryBean#setJtaTransactionManager
* @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 {

private final TransactionManager transactionManager;
Expand Down
Expand Up @@ -100,7 +100,9 @@
* @see HibernateTransactionManager
* @see org.springframework.transaction.jta.JtaTransactionManager
* @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 {

/**
Expand Down
Expand Up @@ -37,7 +37,9 @@
* @since 1.2
* @see HibernateTransactionManager
* @see SessionFactoryUtils
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class SessionHolder extends ResourceHolderSupport {

private static final Object DEFAULT_KEY = new Object();
Expand Down
Expand Up @@ -37,7 +37,9 @@
* @since 2.0
* @see SessionFactoryUtils#doGetSession
* @see LocalSessionFactoryBean#setExposeTransactionAwareSessionFactory
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
@SuppressWarnings("serial")
public class SpringSessionContext implements CurrentSessionContext {

Expand Down
Expand Up @@ -42,7 +42,9 @@
* @since 1.2
* @see SessionFactoryUtils
* @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 {

private final SessionHolder sessionHolder;
Expand Down
Expand Up @@ -36,7 +36,9 @@
* @since 2.5.4
* @see org.springframework.transaction.support.TransactionSynchronizationManager
* @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 {

/**
Expand Down
Expand Up @@ -28,7 +28,9 @@
* @author Juergen Hoeller
* @since 1.2
* @see LocalSessionFactoryBean#setUseTransactionAwareDataSource
* @deprecated as of Spring 4.3, in favor of Hibernate 4.x/5.x
*/
@Deprecated
public class TransactionAwareDataSourceConnectionProvider extends LocalDataSourceConnectionProvider {

/**
Expand Down
Expand Up @@ -48,7 +48,9 @@
* @author Juergen Hoeller
* @since 1.2
* @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 {

private String typeName;
Expand Down
Expand Up @@ -38,7 +38,6 @@
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.core.type.filter.TypeFilter;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
import org.springframework.util.ClassUtils;

/**
Expand Down Expand Up @@ -74,8 +73,11 @@
* @see #setHibernateProperties
* @see #setAnnotatedClasses
* @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";

Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobCreatorUtils;
import org.springframework.jdbc.support.lob.LobHandler;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;

/**
* Abstract base class for Hibernate UserType implementations that map to LOBs.
Expand All @@ -52,7 +51,9 @@
* @see org.springframework.jdbc.support.lob.LobCreator
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setLobHandler
* @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 {

protected final Log logger = LogFactory.getLog(getClass());
Expand All @@ -69,8 +70,8 @@ public abstract class AbstractLobType implements UserType {
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#getConfigTimeTransactionManager
*/
protected AbstractLobType() {
this(LocalSessionFactoryBean.getConfigTimeLobHandler(),
LocalSessionFactoryBean.getConfigTimeTransactionManager());
this(org.springframework.orm.hibernate3.LocalSessionFactoryBean.getConfigTimeLobHandler(),
org.springframework.orm.hibernate3.LocalSessionFactoryBean.getConfigTimeTransactionManager());
}

/**
Expand Down
Expand Up @@ -22,8 +22,6 @@
import org.apache.commons.logging.LogFactory;
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.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter;
Expand All @@ -40,19 +38,21 @@
*
* @author Rossen Stoyanchev
* @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 {

private static final Log logger = LogFactory.getLog(AsyncRequestInterceptor.class);

private final SessionFactory sessionFactory;

private final SessionHolder sessionHolder;
private final org.springframework.orm.hibernate3.SessionHolder sessionHolder;

private volatile boolean timeoutInProgress;


public AsyncRequestInterceptor(SessionFactory sessionFactory, SessionHolder sessionHolder) {
public AsyncRequestInterceptor(SessionFactory sessionFactory, org.springframework.orm.hibernate3.SessionHolder sessionHolder) {
this.sessionFactory = sessionFactory;
this.sessionHolder = sessionHolder;
}
Expand Down Expand Up @@ -87,7 +87,7 @@ public <T> void afterCompletion(NativeWebRequest request, Callable<T> task) thro
private void closeAfterTimeout() {
if (this.timeoutInProgress) {
logger.debug("Closing Hibernate Session after async request timeout");
SessionFactoryUtils.closeSession(this.sessionHolder.getSession());
org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(this.sessionHolder.getSession());
}
}

Expand Down
Expand Up @@ -38,7 +38,9 @@
* @author Juergen Hoeller
* @since 1.2
* @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 {

/**
Expand Down
Expand Up @@ -46,7 +46,9 @@
* @author Juergen Hoeller
* @since 1.2
* @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 {

/**
Expand Down
Expand Up @@ -44,7 +44,9 @@
* @since 1.2.7
* @see #getCharacterEncoding()
* @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 {

/**
Expand Down
Expand Up @@ -40,7 +40,9 @@
* @author Juergen Hoeller
* @since 1.2
* @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 {

/**
Expand Down

0 comments on commit e909422

Please sign in to comment.