deprecated JpaTemplate and co in favor of native EntityManager usage

This commit is contained in:
Juergen Hoeller 2011-10-11 16:24:32 +00:00
parent 0d02ef5fe5
commit feed594ba4
6 changed files with 28 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -39,7 +39,10 @@ import org.springframework.dao.support.DataAccessUtils;
* @see JpaTemplate
* @see JpaInterceptor
* @see JpaDialect
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
* (typically obtained through <code>@PersistenceContext</code>)
*/
@Deprecated
public abstract class JpaAccessor extends EntityManagerFactoryAccessor implements InitializingBean {
private EntityManager entityManager;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -29,7 +29,10 @@ import javax.persistence.PersistenceException;
* @since 2.0
* @see org.springframework.orm.jpa.JpaTemplate
* @see org.springframework.orm.jpa.JpaTransactionManager
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
* (typically obtained through <code>@PersistenceContext</code>)
*/
@Deprecated
public interface JpaCallback<T> {
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -62,7 +62,12 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* @since 2.0
* @see JpaTransactionManager
* @see JpaTemplate
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
* (typically obtained through <code>@PersistenceContext</code>) and
* AOP-driven exception translation through
* {@link org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor}
*/
@Deprecated
public class JpaInterceptor extends JpaAccessor implements MethodInterceptor {
private boolean exceptionConversionEnabled = true;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -46,7 +46,11 @@ import org.springframework.dao.DataAccessException;
* @see JpaDialect
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
* (typically obtained through <code>@PersistenceContext</code>).
* Note that this interface did not get upgraded to JPA 2.0 and never will.
*/
@Deprecated
public interface JpaOperations {
<T> T execute(JpaCallback<T> action) throws DataAccessException;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -85,7 +85,11 @@ import org.springframework.util.ClassUtils;
* @see org.springframework.transaction.jta.JtaTransactionManager
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
* (typically obtained through <code>@PersistenceContext</code>)
* Note that this class did not get upgraded to JPA 2.0 and never will.
*/
@Deprecated
public class JpaTemplate extends JpaAccessor implements JpaOperations {
private boolean exposeNativeEntityManager = false;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -43,7 +43,10 @@ import org.springframework.orm.jpa.JpaTemplate;
* @see #createJpaTemplate
* @see #setJpaTemplate
* @see org.springframework.orm.jpa.JpaTemplate
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
* (typically obtained through <code>@PersistenceContext</code>)
*/
@Deprecated
public abstract class JpaDaoSupport extends DaoSupport {
private JpaTemplate jpaTemplate;