001package gudusoft.gsqlparser.stmt; 002 003import gudusoft.gsqlparser.*; 004import gudusoft.gsqlparser.nodes.TParseTreeVisitor; 005import gudusoft.gsqlparser.nodes.TObjectName; 006import gudusoft.gsqlparser.nodes.TConstant; 007import gudusoft.gsqlparser.nodes.TBeginTranSqlNode; 008 009public class TBeginTran extends TCustomSqlStatement { 010 public TBeginTran(EDbVendor dbvendor){ 011 super(dbvendor); 012 sqlstatementtype = ESqlStatementType.sstbegintran ; 013 } 014 015 void buildsql() { 016 } 017 018 void clear() { 019 } 020 021 String getasprettytext() { 022 return ""; 023 } 024 025 void iterate(TVisitorAbs pvisitor) { 026 } 027 028 private TObjectName transactionName = null; 029 030 public TObjectName getTransactionName() { 031 return transactionName; 032 } 033 034 private boolean distributed = false; 035 private boolean withMark = false; 036 private TConstant withMarkDescription = null; 037 038 public boolean isDistributed() { 039 return distributed; 040 } 041 042 public boolean isWithMark() { 043 return withMark; 044 } 045 046 public TConstant getWithMarkDescription() { 047 return withMarkDescription; 048 } 049 050 public int doParseStatement(TCustomSqlStatement psql) { 051 if (rootNode == null) return -1; 052 TBeginTranSqlNode node = (TBeginTranSqlNode)rootNode; 053 super.doParseStatement(psql); 054 055 this.transactionName = node.getTransactionName(); 056 this.distributed = node.isDistributed(); 057 this.withMark = node.isWithMark(); 058 this.withMarkDescription = node.getWithMarkDescription(); 059 060 return 0; 061 } 062 063 public void accept(TParseTreeVisitor v){ 064 v.preVisit(this); 065 v.postVisit(this); 066 } 067 068 public void acceptChildren(TParseTreeVisitor v){ 069 v.preVisit(this); 070 v.postVisit(this); 071 } 072 073 public void setTransactionName(TObjectName transactionName) { 074 this.transactionName = transactionName; 075 } 076 077 public void setDistributed(boolean distributed) { 078 this.distributed = distributed; 079 } 080 081 public void setWithMark(boolean withMark) { 082 this.withMark = withMark; 083 } 084 085 public void setWithMarkDescription(TConstant withMarkDescription) { 086 this.withMarkDescription = withMarkDescription; 087 } 088}