This is an automated email from the ASF dual-hosted git repository. zhangliang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push: new 3747f15ca44 Refactor RollbackStatement (#35558) 3747f15ca44 is described below commit 3747f15ca44a28facb665a0a0237a2d313f9d96a Author: Liang Zhang <zhangli...@apache.org> AuthorDate: Fri May 30 01:30:42 2025 +0800 Refactor RollbackStatement (#35558) * Refactor RollbackStatement * Refactor RollbackStatement --- .../type/OpenGaussTCLStatementVisitor.java | 8 +++---- .../statement/type/OracleTCLStatementVisitor.java | 4 ++-- .../type/PostgreSQLTCLStatementVisitor.java | 8 +++---- .../statement/type/SQL92TCLStatementVisitor.java | 6 ++--- .../opengauss/OpenGaussStatementCreator.java | 3 +-- .../opengauss/tcl/OpenGaussRollbackStatement.java | 27 ---------------------- .../oracle/tcl/OracleRollbackStatement.java | 27 ---------------------- .../postgresql/PostgreSQLStatementCreator.java | 3 +-- .../tcl/PostgreSQLRollbackStatement.java | 27 ---------------------- .../sql92/tcl/SQL92RollbackStatement.java | 27 ---------------------- .../command/query/PostgreSQLCommandTest.java | 4 ++-- 11 files changed, 17 insertions(+), 127 deletions(-) diff --git a/parser/sql/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussTCLStatementVisitor.java b/parser/sql/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussTCLStatementVisitor.java index afe5b634d4f..fd3ea67cc85 100644 --- a/parser/sql/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussTCLStatementVisitor.java +++ b/parser/sql/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussTCLStatementVisitor.java @@ -34,13 +34,13 @@ import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.Set import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.SetTransactionContext; import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.StartTransactionContext; import org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.OpenGaussStatementVisitor; +import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussBeginTransactionStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussCheckpointStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussCommitPreparedStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussCommitStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussReleaseSavepointStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussRollbackPreparedStatement; -import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussRollbackStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussSavepointStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussSetConstraintsStatement; import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussSetTransactionStatement; @@ -68,12 +68,12 @@ public final class OpenGaussTCLStatementVisitor extends OpenGaussStatementVisito @Override public ASTNode visitRollback(final RollbackContext ctx) { - return new OpenGaussRollbackStatement(); + return new RollbackStatement(); } @Override public ASTNode visitAbort(final AbortContext ctx) { - return new OpenGaussRollbackStatement(); + return new RollbackStatement(); } @Override @@ -86,7 +86,7 @@ public final class OpenGaussTCLStatementVisitor extends OpenGaussStatementVisito @Override public ASTNode visitRollbackToSavepoint(final RollbackToSavepointContext ctx) { - OpenGaussRollbackStatement result = new OpenGaussRollbackStatement(); + RollbackStatement result = new RollbackStatement(); result.setSavepointName(ctx.colId().getText()); return result; } diff --git a/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleTCLStatementVisitor.java b/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleTCLStatementVisitor.java index a360d7dbd5e..5ef7204f8c1 100644 --- a/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleTCLStatementVisitor.java +++ b/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleTCLStatementVisitor.java @@ -26,10 +26,10 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.Savepo import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.SetConstraintsContext; import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.SetTransactionContext; import org.apache.shardingsphere.sql.parser.oracle.visitor.statement.OracleStatementVisitor; +import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue; import org.apache.shardingsphere.sql.parser.statement.oracle.dml.OracleLockStatement; import org.apache.shardingsphere.sql.parser.statement.oracle.tcl.OracleCommitStatement; -import org.apache.shardingsphere.sql.parser.statement.oracle.tcl.OracleRollbackStatement; import org.apache.shardingsphere.sql.parser.statement.oracle.tcl.OracleSavepointStatement; import org.apache.shardingsphere.sql.parser.statement.oracle.tcl.OracleSetConstraintsStatement; import org.apache.shardingsphere.sql.parser.statement.oracle.tcl.OracleSetTransactionStatement; @@ -51,7 +51,7 @@ public final class OracleTCLStatementVisitor extends OracleStatementVisitor impl @Override public ASTNode visitRollback(final RollbackContext ctx) { - OracleRollbackStatement result = new OracleRollbackStatement(); + RollbackStatement result = new RollbackStatement(); if (null != ctx.savepointClause().savepointName()) { result.setSavepointName(((IdentifierValue) visit(ctx.savepointClause().savepointName())).getValue()); } diff --git a/parser/sql/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLTCLStatementVisitor.java b/parser/sql/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLTCLStatementVisitor.java index 7cc6c9b23e3..5ed2e522858 100644 --- a/parser/sql/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLTCLStatementVisitor.java +++ b/parser/sql/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLTCLStatementVisitor.java @@ -41,6 +41,7 @@ import org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.Postgre import org.apache.shardingsphere.sql.parser.statement.core.enums.TransactionAccessType; import org.apache.shardingsphere.sql.parser.statement.core.enums.TransactionIsolationLevel; import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SimpleTableSegment; +import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.dml.PostgreSQLCheckpointStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLBeginTransactionStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLCommitPreparedStatement; @@ -49,7 +50,6 @@ import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLL import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLPrepareTransactionStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLReleaseSavepointStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLRollbackPreparedStatement; -import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLRollbackStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLSavepointStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLSetConstraintsStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLSetTransactionStatement; @@ -117,12 +117,12 @@ public final class PostgreSQLTCLStatementVisitor extends PostgreSQLStatementVisi @Override public ASTNode visitRollback(final RollbackContext ctx) { - return new PostgreSQLRollbackStatement(); + return new RollbackStatement(); } @Override public ASTNode visitAbort(final AbortContext ctx) { - return new PostgreSQLRollbackStatement(); + return new RollbackStatement(); } @Override @@ -135,7 +135,7 @@ public final class PostgreSQLTCLStatementVisitor extends PostgreSQLStatementVisi @Override public ASTNode visitRollbackToSavepoint(final RollbackToSavepointContext ctx) { - PostgreSQLRollbackStatement result = new PostgreSQLRollbackStatement(); + RollbackStatement result = new RollbackStatement(); result.setSavepointName(ctx.colId().getText()); return result; } diff --git a/parser/sql/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92TCLStatementVisitor.java b/parser/sql/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92TCLStatementVisitor.java index 465ef59d512..4f7aaf427ee 100644 --- a/parser/sql/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92TCLStatementVisitor.java +++ b/parser/sql/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92TCLStatementVisitor.java @@ -22,10 +22,10 @@ import org.apache.shardingsphere.sql.parser.api.visitor.statement.type.TCLStatem import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.CommitContext; import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.RollbackContext; import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.SetTransactionContext; +import org.apache.shardingsphere.sql.parser.sql92.visitor.statement.SQL92StatementVisitor; +import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; import org.apache.shardingsphere.sql.parser.statement.sql92.tcl.SQL92CommitStatement; -import org.apache.shardingsphere.sql.parser.statement.sql92.tcl.SQL92RollbackStatement; import org.apache.shardingsphere.sql.parser.statement.sql92.tcl.SQL92SetTransactionStatement; -import org.apache.shardingsphere.sql.parser.sql92.visitor.statement.SQL92StatementVisitor; /** * TCL statement visitor for SQL92. @@ -44,6 +44,6 @@ public final class SQL92TCLStatementVisitor extends SQL92StatementVisitor implem @Override public ASTNode visitRollback(final RollbackContext ctx) { - return new SQL92RollbackStatement(); + return new RollbackStatement(); } } diff --git a/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/OpenGaussStatementCreator.java b/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/OpenGaussStatementCreator.java index 3f41f71b1b8..2f458cb7740 100644 --- a/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/OpenGaussStatementCreator.java +++ b/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/OpenGaussStatementCreator.java @@ -19,7 +19,6 @@ package org.apache.shardingsphere.sql.parser.statement.opengauss; import org.apache.shardingsphere.sql.parser.statement.core.DialectSQLStatementCreator; import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; -import org.apache.shardingsphere.sql.parser.statement.opengauss.tcl.OpenGaussRollbackStatement; /** * Statement creator for openGauss. @@ -28,6 +27,6 @@ public final class OpenGaussStatementCreator implements DialectSQLStatementCreat @Override public RollbackStatement createRollbackStatement() { - return new OpenGaussRollbackStatement(); + return new RollbackStatement(); } } diff --git a/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/tcl/OpenGaussRollbackStatement.java b/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/tcl/OpenGaussRollbackStatement.java deleted file mode 100644 index d430a81504d..00000000000 --- a/parser/sql/statement/type/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/statement/opengauss/tcl/OpenGaussRollbackStatement.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.shardingsphere.sql.parser.statement.opengauss.tcl; - -import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; -import org.apache.shardingsphere.sql.parser.statement.opengauss.OpenGaussStatement; - -/** - * OpenGauss rollback statement. - */ -public final class OpenGaussRollbackStatement extends RollbackStatement implements OpenGaussStatement { -} diff --git a/parser/sql/statement/type/oracle/src/main/java/org/apache/shardingsphere/sql/parser/statement/oracle/tcl/OracleRollbackStatement.java b/parser/sql/statement/type/oracle/src/main/java/org/apache/shardingsphere/sql/parser/statement/oracle/tcl/OracleRollbackStatement.java deleted file mode 100644 index c31b9412a87..00000000000 --- a/parser/sql/statement/type/oracle/src/main/java/org/apache/shardingsphere/sql/parser/statement/oracle/tcl/OracleRollbackStatement.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.shardingsphere.sql.parser.statement.oracle.tcl; - -import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; -import org.apache.shardingsphere.sql.parser.statement.oracle.OracleStatement; - -/** - * Oracle rollback statement. - */ -public final class OracleRollbackStatement extends RollbackStatement implements OracleStatement { -} diff --git a/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/PostgreSQLStatementCreator.java b/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/PostgreSQLStatementCreator.java index 838a892f0e2..f50415b4391 100644 --- a/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/PostgreSQLStatementCreator.java +++ b/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/PostgreSQLStatementCreator.java @@ -19,7 +19,6 @@ package org.apache.shardingsphere.sql.parser.statement.postgresql; import org.apache.shardingsphere.sql.parser.statement.core.DialectSQLStatementCreator; import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; -import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLRollbackStatement; /** * Statement creator for PostgreSQL. @@ -28,6 +27,6 @@ public final class PostgreSQLStatementCreator implements DialectSQLStatementCrea @Override public RollbackStatement createRollbackStatement() { - return new PostgreSQLRollbackStatement(); + return new RollbackStatement(); } } diff --git a/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/tcl/PostgreSQLRollbackStatement.java b/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/tcl/PostgreSQLRollbackStatement.java deleted file mode 100644 index 617a8a71a36..00000000000 --- a/parser/sql/statement/type/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/tcl/PostgreSQLRollbackStatement.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.shardingsphere.sql.parser.statement.postgresql.tcl; - -import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; -import org.apache.shardingsphere.sql.parser.statement.postgresql.PostgreSQLStatement; - -/** - * PostgreSQL rollback statement. - */ -public final class PostgreSQLRollbackStatement extends RollbackStatement implements PostgreSQLStatement { -} diff --git a/parser/sql/statement/type/sql92/src/main/java/org/apache/shardingsphere/sql/parser/statement/sql92/tcl/SQL92RollbackStatement.java b/parser/sql/statement/type/sql92/src/main/java/org/apache/shardingsphere/sql/parser/statement/sql92/tcl/SQL92RollbackStatement.java deleted file mode 100644 index 3f8a4c5efad..00000000000 --- a/parser/sql/statement/type/sql92/src/main/java/org/apache/shardingsphere/sql/parser/statement/sql92/tcl/SQL92RollbackStatement.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.shardingsphere.sql.parser.statement.sql92.tcl; - -import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; -import org.apache.shardingsphere.sql.parser.statement.sql92.SQL92Statement; - -/** - * SQL92 rollback statement. - */ -public final class SQL92RollbackStatement extends RollbackStatement implements SQL92Statement { -} diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/PostgreSQLCommandTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/PostgreSQLCommandTest.java index e508581864c..2cd76b49dd9 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/PostgreSQLCommandTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/PostgreSQLCommandTest.java @@ -51,6 +51,7 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.dml.DoState import org.apache.shardingsphere.sql.parser.statement.core.statement.dml.InsertStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.dml.SelectStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.dml.UpdateStatement; +import org.apache.shardingsphere.sql.parser.statement.core.statement.tcl.RollbackStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.dal.PostgreSQLResetParameterStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.dal.PostgreSQLSetStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.dal.PostgreSQLVacuumStatement; @@ -69,7 +70,6 @@ import org.apache.shardingsphere.sql.parser.statement.postgresql.dml.PostgreSQLU import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLBeginTransactionStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLCommitStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLReleaseSavepointStatement; -import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLRollbackStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLSavepointStatement; import org.apache.shardingsphere.sql.parser.statement.postgresql.tcl.PostgreSQLStartTransactionStatement; import org.junit.jupiter.api.Test; @@ -318,7 +318,7 @@ class PostgreSQLCommandTest { @Test void assertValueOfRollbackStatement() { - assertThat(PostgreSQLCommand.valueOf(PostgreSQLRollbackStatement.class).orElse(null), is(PostgreSQLCommand.ROLLBACK)); + assertThat(PostgreSQLCommand.valueOf(RollbackStatement.class).orElse(null), is(PostgreSQLCommand.ROLLBACK)); assertThat(PostgreSQLCommand.ROLLBACK.getTag(), is("ROLLBACK")); }