From 4b889f9b90e7cc4c3812aad0c88a3816634bede5 Mon Sep 17 00:00:00 2001
From: Mahmoud Ben Hassine
Date: Wed, 28 Feb 2018 17:03:08 +0100
Subject: [PATCH] BATCH-2587: Deprecate the use of the Neo4jOperations API
---
.../batch/item/data/AbstractNeo4jItemReader.java | 14 +++++++++++++-
.../batch/item/data/Neo4jItemWriter.java | 6 +++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractNeo4jItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractNeo4jItemReader.java
index 2724a7094..b0f8fb5de 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractNeo4jItemReader.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractNeo4jItemReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2016 the original author or authors.
+ * Copyright 2012-2018 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.
@@ -55,6 +55,7 @@ import org.springframework.util.StringUtils;
*
*
* @author Michael Minella
+ * @author Mahmoud Ben Hassine
* @since 3.07
*/
public abstract class AbstractNeo4jItemReader extends
@@ -148,11 +149,22 @@ public abstract class AbstractNeo4jItemReader extends
*
* @param template the Neo4jOperations instance to use
* @see Neo4jOperations
+ * @deprecated This API will be removed in v4.x in favor of
+ * {@code setSessionFactory(org.neo4j.ogm.session.SessionFactory sessionFactory)}.
*/
+ @Deprecated
public void setTemplate(Neo4jOperations template) {
this.template = template;
}
+ /**
+ * Get the Neo4jOperations instance used by this reader.
+ *
+ * @return the Neo4jOperations instance used by this reader
+ * @deprecated This API will be removed in v4.x in favor of
+ * {@code org.neo4j.ogm.session.SessionFactory getSessionFactory()}.
+ */
+ @Deprecated
protected final Neo4jOperations getTemplate() {
return this.template;
}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java
index e64f1288e..90a0d5080 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 the original author or authors.
+ * Copyright 2012-2018 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.
@@ -38,6 +38,7 @@ import org.springframework.util.CollectionUtils;
*
*
* @author Michael Minella
+ * @author Mahmoud Ben Hassine
*
*/
public class Neo4jItemWriter implements ItemWriter, InitializingBean {
@@ -57,7 +58,10 @@ public class Neo4jItemWriter implements ItemWriter, InitializingBean {
* Set the {@link Neo4jOperations} to be used to save items
*
* @param template the template implementation to be used
+ * @deprecated This API will be removed in v4.x in favor of
+ * {@code setSessionFactory(org.neo4j.ogm.session.SessionFactory sessionFactory)}.
*/
+ @Deprecated
public void setTemplate(Neo4jOperations template) {
this.template = template;
}