1 /* JJT: 0.2.2 */ 2 3 package mobisnap.mobile_trx; 4 5 import java.util.*; 6 7 public class ASTUpdateStatement extends mobisnap.mobile_trx.SimpleNode { 8 public ASTTableReference table; 9 public ASTSQLExpression where; 10 public boolean simpleUpdate = true; 11 public Vector updates; // list of update 12 public String tableId; 13 14 public class update { 15 public ASTTableColumn column; 16 public ASTSQLExpression expr; 17 18 public update( ASTTableColumn column, ASTSQLExpression expr) { 19 this.column = column; 20 this.expr = expr; 21 } 22 } 23 24 /*** Accept the visitor. **/ 25 public Object jjtAccept(MobisnapSQLVisitor visitor, Object data) { 26 return visitor.visit(this, data); 27 } 28 29 public ASTUpdateStatement(int id) { 30 super(id); 31 updates = new Vector(); 32 } 33 34 public ASTUpdateStatement( MobisnapSQL p, int i) { 35 super( p, i); 36 id = i; 37 updates = new Vector(); 38 } 39 40 public void insert( ASTTableColumn column, ASTSQLExpression expr) { 41 updates.addElement( new update( column, expr)); 42 } 43 44 public void process( int msql_type) throws Exception { 45 StringBuffer buf = new StringBuffer(); 46 sourceCode( msql_type, buf); 47 MobisnapSQL.transaction.executeUpdate( buf.toString().trim()); 48 } 49 50 }

This page was automatically generated by Maven