revise trigger

This commit is contained in:
XudongXie 2024-09-20 23:20:05 +08:00
parent 7cc485ab95
commit e10c31a36c
2 changed files with 17 additions and 2 deletions

View File

@ -395,9 +395,17 @@ public class OpenGaussGenerator {
DataTypeConvert((TriggerDeclareContentNode) node);
}
}
for (ASTNode child : node.getChildren()) {
visitTrigger(child);
if (!(node.getFirstChild() instanceof TriggerDeclareNode || node.getFirstChild() instanceof TriggerBeginNode)) {
for (ASTNode child : node.getChildren()) {
visitTrigger(child);
}
}
else {
// TODO: need to handle trigger body
}
}
private void visitPLSQL(ASTNode node) {

View File

@ -110,6 +110,13 @@ public abstract class ASTNode {
return null;
}
public ASTNode getFirstChild() {
if (hasChild())
return children.get(0);
else
return null;
}
public List<ASTNode> getChildrenByName(String childName) {
List<ASTNode> nodes = new ArrayList<>();
for (ASTNode child : children) {