1 /* JJT: 0.2.2 */
2
3 package mobisnap.mobile_trx;
4
5 import java.util.*;
6
7 public class ASTGetReservation extends mobisnap.mobile_trx.SimpleNode {
8 public int type;
9 public ASTTableColumn columnname;
10 public ASTTableReference tablename;
11 public ASTPlSqlSimpleExpression duration;
12 public ASTPlSqlSimpleExpression expires;
13 public ASTPlSqlSimpleExpression value;
14 public ASTPlSqlSimpleExpression instances;
15
16 class Column {
17 ASTTableColumn column;
18 ASTRelop relop;
19 ASTPlSqlSimpleExpression expr;
20
21 public Column( ASTTableColumn column, ASTRelop relop, ASTPlSqlSimpleExpression expr) {
22 this.column = column;
23 this.relop = relop;
24 this.expr = expr;
25 }
26
27 };
28 Vector specification;
29 Vector slot;
30
31
32 public ASTGetReservation(int id) {
33 super(id);
34 specification = new Vector();
35 slot = new Vector();
36 }
37
38 public ASTGetReservation( MobisnapSQL p, int i) {
39 super( p, i);
40 id = i;
41 specification = new Vector();
42 }
43
44 /*** Accept the visitor. **/
45 public Object jjtAccept(MobisnapSQLVisitor visitor, Object data) {
46 return visitor.visit(this, data);
47 }
48
49 public void insert( ASTTableColumn column, ASTRelop relop, ASTPlSqlSimpleExpression expr) {
50 specification.addElement( new Column( column, relop, expr));
51 }
52
53 public void insertSlot( ASTTableColumn column, ASTRelop relop, ASTPlSqlSimpleExpression expr) {
54 slot.addElement( new Column( column, relop, expr));
55 }
56
57 public int numConditions() {
58 return specification.size();
59 }
60
61 public ColumnCondition getSlot( int num) throws Exception {
62 Column column = (Column)slot.elementAt( num);
63 StringBuffer buffer = new StringBuffer();
64 column.column.sourceCode( mobisnap.MobisnapConstants.MSQL_SERVER, buffer);
65 return new RelopCondition( buffer.toString().trim(), column.relop.type, column.expr.value( mobisnap.MobisnapConstants.MSQL_SERVER, false));
66 }
67
68 public ColumnCondition getColumnCond( int num) throws Exception {
69 Column column = (Column)specification.elementAt( num);
70 StringBuffer buffer = new StringBuffer();
71 column.column.sourceCode( mobisnap.MobisnapConstants.MSQL_SERVER, buffer);
72 return new RelopCondition( buffer.toString().trim(), column.relop.type, column.expr.value( mobisnap.MobisnapConstants.MSQL_SERVER, false));
73 }
74
75 }
This page was automatically generated by Maven