Skip to content

Commit 0a75bc7

Browse files
committed
Deprecate Hibernate support
Resolves #4150
1 parent 4d0ed63 commit 0a75bc7

10 files changed

+34
-7
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateCursorItemReader.java

+2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
* @author Robert Kasanicky
5454
* @author Dave Syer
5555
* @author Mahmoud Ben Hassine
56+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaCursorItemReader} instead.
5657
*/
58+
@Deprecated(since = "5.0", forRemoval = true)
5759
public class HibernateCursorItemReader<T> extends AbstractItemCountingItemStreamItemReader<T>
5860
implements InitializingBean {
5961

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateItemReaderHelper.java

+2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
* @author Dave Syer
3838
* @author Mahmoud Ben Hassine
3939
* @author June Young. Park
40+
* @deprecated since 5.0 for removal in 5.2. Use the JPA item readers instead.
4041
*/
42+
@Deprecated(since = "5.0", forRemoval = true)
4143
public class HibernateItemReaderHelper<T> implements InitializingBean {
4244

4345
private SessionFactory sessionFactory;

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateItemWriter.java

+2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343
* @author Thomas Risberg
4444
* @author Michael Minella
4545
* @author Mahmoud Ben Hassine
46+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaItemWriter} instead.
4647
*
4748
*/
49+
@Deprecated(since = "5.0", forRemoval = true)
4850
public class HibernateItemWriter<T> implements ItemWriter<T>, InitializingBean {
4951

5052
protected static final Log logger = LogFactory.getLog(HibernateItemWriter.class);

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernatePagingItemReader.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2013 the original author or authors.
2+
* Copyright 2006-2022 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.
@@ -51,8 +51,11 @@
5151
* </p>
5252
*
5353
* @author Dave Syer
54+
* @author Mahmoud Ben Hassine
5455
* @since 2.1
56+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaPagingItemReader} instead.
5557
*/
58+
@Deprecated(since = "5.0", forRemoval = true)
5659
public class HibernatePagingItemReader<T> extends AbstractPagingItemReader<T> implements InitializingBean {
5760

5861
private HibernateItemReaderHelper<T> helper = new HibernateItemReaderHelper<>();

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernateCursorItemReaderBuilder.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 the original author or authors.
2+
* Copyright 2017-2022 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.
@@ -40,7 +40,10 @@
4040
* @author Mahmoud Ben Hassine
4141
* @since 4.0
4242
* @see HibernateCursorItemReader
43+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaCursorItemReaderBuilder}
44+
* instead.
4345
*/
46+
@Deprecated(since = "5.0", forRemoval = true)
4447
public class HibernateCursorItemReaderBuilder<T> {
4548

4649
private Map<String, Object> parameterValues;

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernateItemWriterBuilder.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 the original author or authors.
2+
* Copyright 2017-2022 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.
@@ -24,9 +24,12 @@
2424
* A builder for the {@link HibernateItemWriter}
2525
*
2626
* @author Michael Minella
27+
* @author Mahmoud Ben Hassine
2728
* @since 4.0
2829
* @see HibernateItemWriter
30+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaItemWriterBuilder} instead.
2931
*/
32+
@Deprecated(since = "5.0", forRemoval = true)
3033
public class HibernateItemWriterBuilder<T> {
3134

3235
private boolean clearSession = true;

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernatePagingItemReaderBuilder.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 the original author or authors.
2+
* Copyright 2017-2022 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.
@@ -38,7 +38,10 @@
3838
* @author Mahmoud Ben Hassine
3939
* @since 4.0
4040
* @see HibernatePagingItemReader
41+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaPagingItemReaderBuilder}
42+
* instead.
4143
*/
44+
@Deprecated(since = "5.0", forRemoval = true)
4245
public class HibernatePagingItemReaderBuilder<T> {
4346

4447
private int pageSize = 10;

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/AbstractHibernateQueryProvider.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2013 the original author or authors.
2+
* Copyright 2006-2022 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.
@@ -35,9 +35,11 @@
3535
*
3636
* @author Anatoly Polinsky
3737
* @author Dave Syer
38+
* @author Mahmoud Ben Hassine
3839
* @since 2.1
3940
*
4041
*/
42+
@Deprecated(since = "5.0", forRemoval = true)
4143
public abstract class AbstractHibernateQueryProvider<T> implements HibernateQueryProvider<T> {
4244

4345
private StatelessSession statelessSession;

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/HibernateNativeQueryProvider.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2008 the original author or authors.
2+
* Copyright 2006-2022 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.
@@ -30,8 +30,12 @@
3030
* </p>
3131
*
3232
* @author Anatoly Polinsky
33+
* @author Mahmoud Ben Hassine
3334
* @param <E> entity returned by executing the query
35+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaNativeQueryProvider}
36+
* instead.
3437
*/
38+
@Deprecated(since = "5.0", forRemoval = true)
3539
public class HibernateNativeQueryProvider<E> extends AbstractHibernateQueryProvider<E> {
3640

3741
private String sqlQuery;

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/HibernateQueryProvider.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2008 the original author or authors.
2+
* Copyright 2006-2022 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,9 +29,12 @@
2929
*
3030
* @author Anatoly Polinsky
3131
* @author Dave Syer
32+
* @author Mahmoud Ben Hassine
3233
* @since 2.1
34+
* @deprecated since 5.0 for removal in 5.2. Use the {@link JpaQueryProvider} instead.
3335
*
3436
*/
37+
@Deprecated(since = "5.0", forRemoval = true)
3538
public interface HibernateQueryProvider<T> {
3639

3740
/**

0 commit comments

Comments
 (0)