From e0eee3fa3a0169c8a78a4772037b3a459221e2f2 Mon Sep 17 00:00:00 2001 From: Florent Biville Date: Sun, 14 Jan 2024 20:28:06 +0100 Subject: [PATCH] Extract duplicated batching aspect to single class --- .../ext/neo4j/change/BatchableChange.java | 77 ++++++++++++++++++ .../neo4j/change/InvertDirectionChange.java | 80 ++++--------------- .../ext/neo4j/change/RenameLabelChange.java | 59 +++----------- .../neo4j/change/RenamePropertyChange.java | 63 +++------------ .../ext/neo4j/change/RenameTypeChange.java | 63 ++++++--------- 5 files changed, 137 insertions(+), 205 deletions(-) create mode 100644 src/main/java/liquibase/ext/neo4j/change/BatchableChange.java diff --git a/src/main/java/liquibase/ext/neo4j/change/BatchableChange.java b/src/main/java/liquibase/ext/neo4j/change/BatchableChange.java new file mode 100644 index 00000000..eefa3c78 --- /dev/null +++ b/src/main/java/liquibase/ext/neo4j/change/BatchableChange.java @@ -0,0 +1,77 @@ +package liquibase.ext.neo4j.change; + +import liquibase.Scope; +import liquibase.change.AbstractChange; +import liquibase.database.Database; +import liquibase.exception.ValidationErrors; +import liquibase.ext.neo4j.database.Neo4jDatabase; +import liquibase.logging.Logger; +import liquibase.statement.SqlStatement; + +abstract class BatchableChange extends AbstractChange { + + protected Boolean enableBatchImport = Boolean.FALSE; + + protected Long batchSize; + + @Override + public ValidationErrors validate(Database database) { + ValidationErrors validation = new ValidationErrors(this); + if (enableBatchImport && getChangeSet().isRunInTransaction()) { + validation.addError("enableBatchImport can be true only if the enclosing change set's runInTransaction attribute is set to false"); + } + if (!enableBatchImport && batchSize != null) { + validation.addError("batch size must be set only if enableBatchImport is set to true"); + } + if (batchSize != null && batchSize <= 0) { + validation.addError("batch size, if set, must be strictly positive"); + } + Neo4jDatabase neo4j = (Neo4jDatabase) database; + if (enableBatchImport && !neo4j.supportsCallInTransactions()) { + validation.addWarning("this version of Neo4j does not support CALL {} IN TRANSACTIONS, all batch import settings are ignored"); + } + validation.addAll(super.validate(database)); + return validation; + } + + @Override + public SqlStatement[] generateStatements(Database database) { + Logger log = Scope.getCurrentScope().getLog(getClass()); + boolean supportsCallInTransactions = ((Neo4jDatabase) database).supportsCallInTransactions(); + if (supportsCallInTransactions && enableBatchImport) { + log.info("Running change in CALL {} IN TRANSACTIONS"); + return generateBatchedStatements(database); + } else if (!supportsCallInTransactions) { + log.warning("This version of Neo4j does not support CALL {} IN TRANSACTIONS, the type rename is going to run in a single, possibly large and slow, transaction.\n" + + "Note: upgrade the Neo4j server or set the runInTransaction attribute of the enclosing change set to true to make this warning disappear."); + } else { + log.info("Running type rename in single transaction (set enableBatchImport to true to switch to CALL {} IN TRANSACTIONS)"); + } + return generateUnbatchedStatements(database); + } + + protected abstract SqlStatement[] generateBatchedStatements(Database database); + + protected abstract SqlStatement[] generateUnbatchedStatements(Database database); + + + public Boolean getEnableBatchImport() { + return enableBatchImport; + } + + public void setEnableBatchImport(Boolean enableBatchImport) { + this.enableBatchImport = enableBatchImport; + } + + public Long getBatchSize() { + return batchSize; + } + + public void setBatchSize(Long batchSize) { + this.batchSize = batchSize; + } + + protected String cypherBatchSpec() { + return batchSize != null ? String.format(" OF %d ROWS", batchSize) : ""; + } +} diff --git a/src/main/java/liquibase/ext/neo4j/change/InvertDirectionChange.java b/src/main/java/liquibase/ext/neo4j/change/InvertDirectionChange.java index 9801ac19..ad3b57f6 100644 --- a/src/main/java/liquibase/ext/neo4j/change/InvertDirectionChange.java +++ b/src/main/java/liquibase/ext/neo4j/change/InvertDirectionChange.java @@ -1,20 +1,14 @@ package liquibase.ext.neo4j.change; import liquibase.Scope; -import liquibase.change.AbstractChange; import liquibase.change.ChangeMetaData; import liquibase.change.DatabaseChange; import liquibase.database.Database; -import liquibase.exception.LiquibaseException; import liquibase.exception.ValidationErrors; import liquibase.ext.neo4j.database.Neo4jDatabase; import liquibase.logging.Logger; import liquibase.statement.SqlStatement; import liquibase.statement.core.RawParameterizedSqlStatement; -import liquibase.statement.core.RawSqlStatement; - -import java.util.List; -import java.util.Map; @DatabaseChange(name = "invertDirection", priority = ChangeMetaData.PRIORITY_DEFAULT, description = "The 'invertDirection' tag allows you to invert the direction of relationships.\n" + @@ -24,7 +18,7 @@ "the relationships to merge. If the fragment is '(:Movie)<-[d:DIRECTED_BY]-(:Director {name: 'John Woo'})-[a:ACTED_IN]->(:Movie)', " + "the output variable is either 'd' or 'a' depending on the relationships the inversion should affect.") -public class InvertDirectionChange extends AbstractChange { +public class InvertDirectionChange extends BatchableChange { private String fragment; @@ -32,10 +26,6 @@ public class InvertDirectionChange extends AbstractChange { private String type; - private Boolean enableBatchImport = Boolean.FALSE; - - private Long batchSize; - @Override public boolean supports(Database database) { return database instanceof Neo4jDatabase; @@ -55,19 +45,6 @@ public ValidationErrors validate(Database database) { if ("__rel__".equals(outputVariable)) { validation.addError(String.format("outputVariable %s clashes with the reserved variable name: __rel__. outputVariable must be renamed and fragment accordingly updated", outputVariable)); } - if (enableBatchImport && getChangeSet().isRunInTransaction()) { - validation.addError("enableBatchImport can be true only if the enclosing change set's runInTransaction attribute is set to false"); - } - if (!enableBatchImport && batchSize != null) { - validation.addError("batch size must be set only if enableBatchImport is set to true"); - } - if (batchSize != null && batchSize <= 0) { - validation.addError("batch size, if set, must be strictly positive"); - } - Neo4jDatabase neo4j = (Neo4jDatabase) database; - if (enableBatchImport && !neo4j.supportsCallInTransactions()) { - validation.addWarning("this version of Neo4j does not support CALL {} IN TRANSACTIONS, all batch import settings are ignored"); - } validation.addAll(super.validate(database)); return validation; } @@ -80,29 +57,21 @@ public String getConfirmationMessage() { return String.format("the direction of relationships with type %s has been inverted", type); } @Override - public SqlStatement[] generateStatements(Database database) { - Logger log = Scope.getCurrentScope().getLog(getClass()); - boolean supportsCallInTransactions = ((Neo4jDatabase) database).supportsCallInTransactions(); - if (supportsCallInTransactions && enableBatchImport) { - log.info("Running type rename in CALL {} IN TRANSACTIONS"); - String batchSpec = batchSize != null ? String.format(" OF %d ROWS", batchSize) : ""; - String cypher = String.format("%s " + - "CALL { " + - " WITH __rel__ " + - " MATCH (__start__) WHERE id(__start__) = id(startNode(__rel__)) " + - " MATCH (__end__) WHERE id(__end__) = id(endNode(__rel__)) " + - " CREATE (__start__)<-[__newrel__:`%s`]-(__end__) " + - " SET __newrel__ = properties(__rel__) " + - " DELETE __rel__ " + - "} IN TRANSACTIONS%s", queryStart(), type, batchSpec); - return new SqlStatement[]{new RawParameterizedSqlStatement(cypher, type)}; - } - if (!supportsCallInTransactions) { - log.warning("This version of Neo4j does not support CALL {} IN TRANSACTIONS, the type rename is going to run in a single, possibly large and slow, transaction.\n" + - "Note: upgrade the Neo4j server or set the runInTransaction attribute of the enclosing change set to true to make this warning disappear."); - } else { - log.info("Running type rename in single transaction (set enableBatchImport to true to switch to CALL {} IN TRANSACTIONS)"); - } + protected SqlStatement[] generateBatchedStatements(Database database) { + String cypher = String.format("%s " + + "CALL { " + + " WITH __rel__ " + + " MATCH (__start__) WHERE id(__start__) = id(startNode(__rel__)) " + + " MATCH (__end__) WHERE id(__end__) = id(endNode(__rel__)) " + + " CREATE (__start__)<-[__newrel__:`%s`]-(__end__) " + + " SET __newrel__ = properties(__rel__) " + + " DELETE __rel__ " + + "} IN TRANSACTIONS%s", queryStart(), type, cypherBatchSpec()); + return new SqlStatement[]{new RawParameterizedSqlStatement(cypher, type)}; + } + + @Override + protected SqlStatement[] generateUnbatchedStatements(Database database) { String cypher = String.format("%s " + "MATCH (__start__) WHERE id(__start__) = id(startNode(__rel__)) " + "MATCH (__end__) WHERE id(__end__) = id(endNode(__rel__)) " + @@ -135,23 +104,6 @@ public String getOutputVariable() { public void setOutputVariable(String outputVariable) { this.outputVariable = outputVariable; } - - public Boolean getEnableBatchImport() { - return enableBatchImport; - } - - public void setEnableBatchImport(Boolean enableBatchImport) { - this.enableBatchImport = enableBatchImport; - } - - public Long getBatchSize() { - return batchSize; - } - - public void setBatchSize(Long batchSize) { - this.batchSize = batchSize; - } - private String queryStart() { if (fragment != null) { return String.format("MATCH %s WITH %s AS __rel__ WHERE type(__rel__) = $1", fragment, outputVariable); diff --git a/src/main/java/liquibase/ext/neo4j/change/RenameLabelChange.java b/src/main/java/liquibase/ext/neo4j/change/RenameLabelChange.java index 03e49e7f..c4c8dc10 100644 --- a/src/main/java/liquibase/ext/neo4j/change/RenameLabelChange.java +++ b/src/main/java/liquibase/ext/neo4j/change/RenameLabelChange.java @@ -19,7 +19,7 @@ "'renameLabel' also defines the 'outputVariable' attribute. This attribute denotes the variable used in the pattern for\n" + "the nodes to merge. If the fragment is '(m:Movie)<-[:DIRECTED_BY]-(d:Director {name: 'John Woo'})', " + "the output variable is either 'm' or 'd' depending on the nodes the rename should affect.") -public class RenameLabelChange extends AbstractChange { +public class RenameLabelChange extends BatchableChange { private String from; @@ -29,10 +29,6 @@ public class RenameLabelChange extends AbstractChange { private String outputVariable; - private Boolean enableBatchImport = Boolean.FALSE; - - private Long batchSize; - @Override public boolean supports(Database database) { return database instanceof Neo4jDatabase; @@ -55,19 +51,6 @@ public ValidationErrors validate(Database database) { if ("__node__".equals(outputVariable)) { validation.addError("__node__ is a reserved variable name, outputVariable must be renamed and fragment accordingly updated"); } - if (enableBatchImport && getChangeSet().isRunInTransaction()) { - validation.addError("enableBatchImport can be true only if the enclosing change set's runInTransaction attribute is set to false"); - } - if (!enableBatchImport && batchSize != null) { - validation.addError("batch size must be set only if enableBatchImport is set to true"); - } - if (batchSize != null && batchSize <= 0) { - validation.addError("batch size, if set, must be strictly positive"); - } - Neo4jDatabase neo4j = (Neo4jDatabase) database; - if (enableBatchImport && !neo4j.supportsCallInTransactions()) { - validation.addWarning("this version of Neo4j does not support CALL {} IN TRANSACTIONS, all batch import settings are ignored"); - } validation.addAll(super.validate(database)); return validation; } @@ -81,21 +64,14 @@ public String getConfirmationMessage() { } @Override - public SqlStatement[] generateStatements(Database database) { - Logger log = Scope.getCurrentScope().getLog(getClass()); - boolean supportsCallInTransactions = ((Neo4jDatabase) database).supportsCallInTransactions(); - if (supportsCallInTransactions && enableBatchImport) { - log.info("Running label rename in CALL {} IN TRANSACTIONS"); - String batchSpec = batchSize != null ? String.format(" OF %d ROWS", batchSize) : ""; - String cypher = String.format("%s CALL {WITH __node__ SET __node__:`%s` REMOVE __node__:`%s`} IN TRANSACTIONS%s", queryStart(), to, from, batchSpec); - return new SqlStatement[]{new RawSqlStatement(cypher)}; - } - if (!supportsCallInTransactions) { - log.warning("This version of Neo4j does not support CALL {} IN TRANSACTIONS, the label rename is going to run in a single, possibly large and slow, transaction.\n" + - "Note: set the runInTransaction attribute of the enclosing change set to true to make this warning disappear."); - } else { - log.info("Running label rename in single transaction (set enableBatchImport to true to switch to CALL {} IN TRANSACTIONS)"); - } + protected SqlStatement[] generateBatchedStatements(Database database) { + String cypher = String.format("%s CALL {WITH __node__ SET __node__:`%s` REMOVE __node__:`%s`} IN TRANSACTIONS%s", + queryStart(), to, from, cypherBatchSpec()); + return new SqlStatement[]{new RawSqlStatement(cypher)}; + } + + @Override + protected SqlStatement[] generateUnbatchedStatements(Database database) { String cypher = String.format("%s SET __node__:`%s` REMOVE __node__:`%s`", queryStart(), to, from); return new SqlStatement[]{new RawSqlStatement(cypher)}; } @@ -116,14 +92,6 @@ public void setTo(String to) { this.to = to; } - public Long getBatchSize() { - return batchSize; - } - - public void setBatchSize(Long batchSize) { - this.batchSize = batchSize; - } - public String getFragment() { return fragment; } @@ -139,15 +107,6 @@ public String getOutputVariable() { public void setOutputVariable(String outputVariable) { this.outputVariable = outputVariable; } - - public void setEnableBatchImport(Boolean enableBatchImport) { - this.enableBatchImport = enableBatchImport; - } - - public Boolean isEnableBatchImport() { - return enableBatchImport; - } - private String queryStart() { if (fragment != null) { return String.format("MATCH %s WITH %s AS __node__ WHERE __node__:`%s`", fragment, outputVariable, from); diff --git a/src/main/java/liquibase/ext/neo4j/change/RenamePropertyChange.java b/src/main/java/liquibase/ext/neo4j/change/RenamePropertyChange.java index 89514352..e60543da 100644 --- a/src/main/java/liquibase/ext/neo4j/change/RenamePropertyChange.java +++ b/src/main/java/liquibase/ext/neo4j/change/RenamePropertyChange.java @@ -1,14 +1,11 @@ package liquibase.ext.neo4j.change; -import liquibase.Scope; -import liquibase.change.AbstractChange; import liquibase.change.ChangeMetaData; import liquibase.change.DatabaseChange; import liquibase.database.Database; import liquibase.exception.ValidationErrors; import liquibase.ext.neo4j.change.refactoring.TargetEntityType; import liquibase.ext.neo4j.database.Neo4jDatabase; -import liquibase.logging.Logger; import liquibase.statement.SqlStatement; import liquibase.statement.core.RawParameterizedSqlStatement; @@ -18,7 +15,7 @@ @DatabaseChange(name = "renameProperty", priority = ChangeMetaData.PRIORITY_DEFAULT, description = "The 'renameProperty' tag allows you to rename the property name ('from' attribute) to another value ('to' attribute).\n" + "By default, all nodes and relationships defining that property will have their matching property renamed.") -public class RenamePropertyChange extends AbstractChange { +public class RenamePropertyChange extends BatchableChange { private String from; @@ -26,10 +23,6 @@ public class RenamePropertyChange extends AbstractChange { private TargetEntityType entityType = TargetEntityType.ALL; - private Boolean enableBatchImport = Boolean.FALSE; - - private Long batchSize; - @Override public boolean supports(Database database) { return database instanceof Neo4jDatabase; @@ -44,19 +37,6 @@ public ValidationErrors validate(Database database) { if (Sequences.isNullOrEmpty(to)) { validation.addError("missing name (to)"); } - if (enableBatchImport && getChangeSet().isRunInTransaction()) { - validation.addError("enableBatchImport can be true only if the enclosing change set's runInTransaction attribute is set to false"); - } - if (!enableBatchImport && batchSize != null) { - validation.addError("batch size must be set only if enableBatchImport is set to true"); - } - if (batchSize != null && batchSize <= 0) { - validation.addError("batch size, if set, must be strictly positive"); - } - Neo4jDatabase neo4j = (Neo4jDatabase) database; - if (enableBatchImport && !neo4j.supportsCallInTransactions()) { - validation.addWarning("this version of Neo4j does not support CALL {} IN TRANSACTIONS, all batch import settings are ignored"); - } validation.addAll(super.validate(database)); return validation; } @@ -79,22 +59,15 @@ public String getConfirmationMessage() { } @Override - public SqlStatement[] generateStatements(Database database) { - Logger log = Scope.getCurrentScope().getLog(getClass()); - boolean supportsCallInTransactions = ((Neo4jDatabase) database).supportsCallInTransactions(); - if (supportsCallInTransactions && enableBatchImport) { - log.info("Running property rename in CALL {} IN TRANSACTIONS"); - String batchSpec = batchSize != null ? String.format(" OF %d ROWS", batchSize) : ""; - String nodeRename = String.format("MATCH (n) WHERE n[$1] IS NOT NULL CALL { WITH n SET n.`%2$s` = n[$1] REMOVE n.`%1$s` } IN TRANSACTIONS%3$s", from, to, batchSpec); - String relRename = String.format("MATCH ()-[r]->() WHERE r[$1] IS NOT NULL CALL { WITH r SET r.`%2$s` = r[$1] REMOVE r.`%1$s` } IN TRANSACTIONS%3$s", from, to, batchSpec); - return filterStatements(nodeRename, relRename); - } - if (!supportsCallInTransactions) { - log.warning("This version of Neo4j does not support CALL {} IN TRANSACTIONS, the type rename is going to run in a single, possibly large and slow, transaction.\n" + - "Note: upgrade the Neo4j server or set the runInTransaction attribute of the enclosing change set to true to make this warning disappear."); - } else { - log.info("Running type rename in single transaction (set enableBatchImport to true to switch to CALL {} IN TRANSACTIONS)"); - } + protected SqlStatement[] generateBatchedStatements(Database database) { + String batchSpec = cypherBatchSpec(); + String nodeRename = String.format("MATCH (n) WHERE n[$1] IS NOT NULL CALL { WITH n SET n.`%2$s` = n[$1] REMOVE n.`%1$s` } IN TRANSACTIONS%3$s", from, to, batchSpec); + String relRename = String.format("MATCH ()-[r]->() WHERE r[$1] IS NOT NULL CALL { WITH r SET r.`%2$s` = r[$1] REMOVE r.`%1$s` } IN TRANSACTIONS%3$s", from, to, batchSpec); + return filterStatements(nodeRename, relRename); + } + + @Override + protected SqlStatement[] generateUnbatchedStatements(Database database) { String nodeRename = String.format("MATCH (n) WHERE n[$1] IS NOT NULL SET n.`%2$s` = n[$1] REMOVE n.`%1$s` ", from, to); String relRename = String.format("MATCH ()-[r]->() WHERE r[$1] IS NOT NULL SET r.`%2$s` = r[$1] REMOVE r.`%1$s`", from, to); return filterStatements(nodeRename, relRename); @@ -124,22 +97,6 @@ public void setEntityType(TargetEntityType entityType) { this.entityType = entityType; } - public Boolean getEnableBatchImport() { - return enableBatchImport; - } - - public void setEnableBatchImport(Boolean enableBatchImport) { - this.enableBatchImport = enableBatchImport; - } - - public Long getBatchSize() { - return batchSize; - } - - public void setBatchSize(Long batchSize) { - this.batchSize = batchSize; - } - private SqlStatement[] filterStatements(String nodeRename, String relRename) { List statements = new ArrayList<>(2); switch (entityType) { diff --git a/src/main/java/liquibase/ext/neo4j/change/RenameTypeChange.java b/src/main/java/liquibase/ext/neo4j/change/RenameTypeChange.java index fa3adf30..86423660 100644 --- a/src/main/java/liquibase/ext/neo4j/change/RenameTypeChange.java +++ b/src/main/java/liquibase/ext/neo4j/change/RenameTypeChange.java @@ -27,7 +27,7 @@ "'renameType' also defines the 'outputVariable' attribute. This attribute denotes the variable used in the pattern for\n" + "the relationships to merge. If the fragment is '(:Movie)<-[d:DIRECTED_BY]-(:Director {name: 'John Woo'})-[a:ACTED_IN]->(:Movie)', " + "the output variable is either 'd' or 'a' depending on the relationships the rename should affect.") -public class RenameTypeChange extends AbstractChange { +public class RenameTypeChange extends BatchableChange { private String from; @@ -37,10 +37,6 @@ public class RenameTypeChange extends AbstractChange { private String outputVariable; - private Boolean enableBatchImport = Boolean.FALSE; - - private Long batchSize; - @Override public boolean supports(Database database) { return database instanceof Neo4jDatabase; @@ -63,19 +59,6 @@ public ValidationErrors validate(Database database) { if ("__rel__".equals(outputVariable)) { validation.addError(String.format("outputVariable %s clashes with the reserved variable name: __rel__. outputVariable must be renamed and fragment accordingly updated", outputVariable)); } - if (enableBatchImport && getChangeSet().isRunInTransaction()) { - validation.addError("enableBatchImport can be true only if the enclosing change set's runInTransaction attribute is set to false"); - } - if (!enableBatchImport && batchSize != null) { - validation.addError("batch size must be set only if enableBatchImport is set to true"); - } - if (batchSize != null && batchSize <= 0) { - validation.addError("batch size, if set, must be strictly positive"); - } - Neo4jDatabase neo4j = (Neo4jDatabase) database; - if (enableBatchImport && !neo4j.supportsCallInTransactions()) { - validation.addWarning("this version of Neo4j does not support CALL {} IN TRANSACTIONS, all batch import settings are ignored"); - } validation.addAll(super.validate(database)); return validation; } @@ -94,9 +77,7 @@ public SqlStatement[] generateStatements(Database database) { boolean supportsCallInTransactions = ((Neo4jDatabase) database).supportsCallInTransactions(); if (supportsCallInTransactions && enableBatchImport) { log.info("Running type rename in CALL {} IN TRANSACTIONS"); - String batchSpec = batchSize != null ? String.format(" OF %d ROWS", batchSize) : ""; - String cypher = String.format("%s CALL {WITH __rel__ MATCH (__start__) WHERE id(__start__) = id(startNode(__rel__)) MATCH (__end__) WHERE id(__end__) = id(endNode(__rel__)) CREATE (__start__)-[__newrel__:`%s`]->(__end__) SET __newrel__ = properties(__rel__) DELETE __rel__ } IN TRANSACTIONS%s", queryStart(), to, batchSpec); - return new SqlStatement[]{new RawParameterizedSqlStatement(cypher, from)}; + } if (!supportsCallInTransactions) { log.warning("This version of Neo4j does not support CALL {} IN TRANSACTIONS, the type rename is going to run in a single, possibly large and slow, transaction.\n" + @@ -108,6 +89,29 @@ public SqlStatement[] generateStatements(Database database) { return new SqlStatement[]{new RawParameterizedSqlStatement(cypher, from)}; } + @Override + protected SqlStatement[] generateBatchedStatements(Database database) { + String cypher = String.format("%s CALL {WITH __rel__ MATCH (__start__) " + + "WHERE id(__start__) = id(startNode(__rel__)) " + + "MATCH (__end__) WHERE id(__end__) = id(endNode(__rel__)) " + + "CREATE (__start__)-[__newrel__:`%s`]->(__end__) " + + "SET __newrel__ = properties(__rel__) " + + "DELETE __rel__ } " + + "IN TRANSACTIONS%s", queryStart(), to, cypherBatchSpec()); + return new SqlStatement[]{new RawParameterizedSqlStatement(cypher, from)}; + } + + @Override + protected SqlStatement[] generateUnbatchedStatements(Database database) { + String cypher = String.format("%s MATCH (__start__) " + + "WHERE id(__start__) = id(startNode(__rel__)) " + + "MATCH (__end__) WHERE id(__end__) = id(endNode(__rel__)) " + + "CREATE (__start__)-[__newrel__:`%s`]->(__end__) " + + "SET __newrel__ = properties(__rel__) " + + "DELETE __rel__", queryStart(), to); + return new SqlStatement[]{new RawParameterizedSqlStatement(cypher, from)}; + } + public String getFrom() { return from; } @@ -124,14 +128,6 @@ public void setTo(String to) { this.to = to; } - public Long getBatchSize() { - return batchSize; - } - - public void setBatchSize(Long batchSize) { - this.batchSize = batchSize; - } - public String getFragment() { return fragment; } @@ -147,15 +143,6 @@ public String getOutputVariable() { public void setOutputVariable(String outputVariable) { this.outputVariable = outputVariable; } - - public void setEnableBatchImport(Boolean enableBatchImport) { - this.enableBatchImport = enableBatchImport; - } - - public Boolean isEnableBatchImport() { - return enableBatchImport; - } - private String queryStart() { if (fragment != null) { return String.format("MATCH %s WITH %s AS __rel__ WHERE type(__rel__) = $1", fragment, outputVariable);