Skip to content

Commit feed594

Browse files
committed
deprecated JpaTemplate and co in favor of native EntityManager usage
1 parent 0d02ef5 commit feed594

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

org.springframework.orm/src/main/java/org/springframework/orm/jpa/JpaAccessor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,10 @@
3939
* @see JpaTemplate
4040
* @see JpaInterceptor
4141
* @see JpaDialect
42+
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
43+
* (typically obtained through <code>@PersistenceContext</code>)
4244
*/
45+
@Deprecated
4346
public abstract class JpaAccessor extends EntityManagerFactoryAccessor implements InitializingBean {
4447

4548
private EntityManager entityManager;

org.springframework.orm/src/main/java/org/springframework/orm/jpa/JpaCallback.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,10 @@
2929
* @since 2.0
3030
* @see org.springframework.orm.jpa.JpaTemplate
3131
* @see org.springframework.orm.jpa.JpaTransactionManager
32+
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
33+
* (typically obtained through <code>@PersistenceContext</code>)
3234
*/
35+
@Deprecated
3336
public interface JpaCallback<T> {
3437

3538
/**

org.springframework.orm/src/main/java/org/springframework/orm/jpa/JpaInterceptor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,7 +62,12 @@
6262
* @since 2.0
6363
* @see JpaTransactionManager
6464
* @see JpaTemplate
65+
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
66+
* (typically obtained through <code>@PersistenceContext</code>) and
67+
* AOP-driven exception translation through
68+
* {@link org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor}
6569
*/
70+
@Deprecated
6671
public class JpaInterceptor extends JpaAccessor implements MethodInterceptor {
6772

6873
private boolean exceptionConversionEnabled = true;

org.springframework.orm/src/main/java/org/springframework/orm/jpa/JpaOperations.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,11 @@
4646
* @see JpaDialect
4747
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
4848
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
49+
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
50+
* (typically obtained through <code>@PersistenceContext</code>).
51+
* Note that this interface did not get upgraded to JPA 2.0 and never will.
4952
*/
53+
@Deprecated
5054
public interface JpaOperations {
5155

5256
<T> T execute(JpaCallback<T> action) throws DataAccessException;

org.springframework.orm/src/main/java/org/springframework/orm/jpa/JpaTemplate.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -85,7 +85,11 @@
8585
* @see org.springframework.transaction.jta.JtaTransactionManager
8686
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
8787
* @see org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
88+
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
89+
* (typically obtained through <code>@PersistenceContext</code>)
90+
* Note that this class did not get upgraded to JPA 2.0 and never will.
8891
*/
92+
@Deprecated
8993
public class JpaTemplate extends JpaAccessor implements JpaOperations {
9094

9195
private boolean exposeNativeEntityManager = false;

org.springframework.orm/src/main/java/org/springframework/orm/jpa/support/JpaDaoSupport.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,7 +43,10 @@
4343
* @see #createJpaTemplate
4444
* @see #setJpaTemplate
4545
* @see org.springframework.orm.jpa.JpaTemplate
46+
* @deprecated as of Spring 3.1, in favor of native EntityManager usage
47+
* (typically obtained through <code>@PersistenceContext</code>)
4648
*/
49+
@Deprecated
4750
public abstract class JpaDaoSupport extends DaoSupport {
4851

4952
private JpaTemplate jpaTemplate;

0 commit comments

Comments
 (0)