Skip to content

Commit adc90b2

Browse files
fmbenhassinemminella
authored andcommitted
Fix typo in method name HibernatePagingItemReaderBuilder#useSatelessSession
Resolves BATCH-2745
1 parent 80d1a24 commit adc90b2

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 the original author or authors.
2+
* Copyright 2017-2018 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,6 +35,7 @@
3535
*
3636
* @author Michael Minella
3737
* @author Glenn Renfro
38+
* @author Mahmoud Ben Hassine
3839
* @since 4.0
3940
* @see HibernatePagingItemReader
4041
*/
@@ -223,8 +224,24 @@ public HibernatePagingItemReaderBuilder<T> sessionFactory(SessionFactory session
223224
* @param useStatelessSession Defaults to false
224225
* @return this instance for method chaining
225226
* @see HibernatePagingItemReader#setUseStatelessSession(boolean)
227+
* @deprecated This method is deprecated in favor of
228+
* {@link HibernatePagingItemReaderBuilder#useStatelessSession} and will be
229+
* removed in version 4.2.
226230
*/
231+
@Deprecated
227232
public HibernatePagingItemReaderBuilder<T> useSatelessSession(boolean useStatelessSession) {
233+
return useStatelessSession(useStatelessSession);
234+
}
235+
236+
/**
237+
* Indicator for whether to use a {@link org.hibernate.StatelessSession}
238+
* (<code>true</code>) or a {@link org.hibernate.Session} (<code>false</code>).
239+
*
240+
* @param useStatelessSession Defaults to false
241+
* @return this instance for method chaining
242+
* @see HibernatePagingItemReader#setUseStatelessSession(boolean)
243+
*/
244+
public HibernatePagingItemReaderBuilder<T> useStatelessSession(boolean useStatelessSession) {
228245
this.statelessSession = useStatelessSession;
229246

230247
return this;

spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/builder/HibernatePagingItemReaderBuilderTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 the original author or authors.
2+
* Copyright 2017-2018 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.
@@ -47,6 +47,7 @@
4747

4848
/**
4949
* @author Michael Minella
50+
* @author Mahmoud Ben Hassine
5051
*/
5152
public class HibernatePagingItemReaderBuilderTests {
5253

@@ -78,7 +79,7 @@ public void testConfiguration() throws Exception {
7879
.maxItemCount(4)
7980
.pageSize(5)
8081
.queryName("allFoos")
81-
.useSatelessSession(false)
82+
.useStatelessSession(false)
8283
.build();
8384

8485
reader.afterPropertiesSet();

0 commit comments

Comments
 (0)