|
9 | 9 | */ |
10 | 10 | package net.sf.jsqlparser.statement; |
11 | 11 |
|
| 12 | +import net.sf.jsqlparser.statement.role.CreateRole; |
| 13 | +import net.sf.jsqlparser.statement.role.AlterRole; |
| 14 | +import net.sf.jsqlparser.statement.role.RoleOption; |
| 15 | +import net.sf.jsqlparser.statement.grant.Revoke; |
| 16 | +import net.sf.jsqlparser.statement.grant.AlterDefaultPrivileges; |
| 17 | + |
12 | 18 | import net.sf.jsqlparser.expression.ExpressionVisitor; |
13 | 19 | import net.sf.jsqlparser.expression.ExpressionVisitorAdapter; |
14 | 20 | import net.sf.jsqlparser.schema.Column; |
@@ -351,6 +357,11 @@ public <S> T visit(CreateTable createTable, S context) { |
351 | 357 |
|
352 | 358 | @Override |
353 | 359 | public <S> T visit(CreateTrigger createTrigger, S context) { |
| 360 | + createTrigger.visit(t -> t.accept(fromItemVisitor, context), |
| 361 | + e -> e.accept(expressionVisitor, context)); |
| 362 | + if (createTrigger.getBody() != null) { |
| 363 | + createTrigger.getBody().accept(this, context); |
| 364 | + } |
354 | 365 | return null; |
355 | 366 | } |
356 | 367 |
|
@@ -495,6 +506,8 @@ public <S> T visit(DeclareStatement declareStatement, S context) { |
495 | 506 |
|
496 | 507 | @Override |
497 | 508 | public <S> T visit(Grant grant, S context) { |
| 509 | + grant.getClause().visit(t -> t.accept(fromItemVisitor, context), |
| 510 | + e -> e.accept(expressionVisitor, context)); |
498 | 511 | return null; |
499 | 512 | } |
500 | 513 |
|
@@ -596,4 +609,45 @@ public <S> T visit(Import imprt, S context) { |
596 | 609 | public <S> T visit(Export export, S context) { |
597 | 610 | return null; |
598 | 611 | } |
| 612 | + |
| 613 | + @Override |
| 614 | + public <S> T visit(CreateRole statement, S context) { |
| 615 | + for (RoleOption option : statement.getOptions()) { |
| 616 | + if (option.getValue() != null) { |
| 617 | + option.getValue().accept(expressionVisitor, context); |
| 618 | + } |
| 619 | + } |
| 620 | + return null; |
| 621 | + } |
| 622 | + |
| 623 | + @Override |
| 624 | + public <S> T visit(AlterRole statement, S context) { |
| 625 | + for (RoleOption option : statement.getOptions()) { |
| 626 | + if (option.getValue() != null) { |
| 627 | + option.getValue().accept(expressionVisitor, context); |
| 628 | + } |
| 629 | + } |
| 630 | + if (statement.getValues() != null) { |
| 631 | + statement.getValues().forEach(e -> e.accept(expressionVisitor, context)); |
| 632 | + } |
| 633 | + return null; |
| 634 | + } |
| 635 | + |
| 636 | + @Override |
| 637 | + public <S> T visit(Revoke statement, S context) { |
| 638 | + statement.getClause().visit(t -> t.accept(fromItemVisitor, context), |
| 639 | + e -> e.accept(expressionVisitor, context)); |
| 640 | + return null; |
| 641 | + } |
| 642 | + |
| 643 | + @Override |
| 644 | + public <S> T visit(AlterDefaultPrivileges statement, S context) { |
| 645 | + if (statement.getGrant() != null) { |
| 646 | + statement.getGrant().accept(this, context); |
| 647 | + } |
| 648 | + if (statement.getRevoke() != null) { |
| 649 | + statement.getRevoke().accept(this, context); |
| 650 | + } |
| 651 | + return null; |
| 652 | + } |
599 | 653 | } |
0 commit comments