1 22 23 package org.xquark.extractor.oracle; 24 25 import org.xquark.extractor.algebra.BinOpArithmetic; 26 import org.xquark.extractor.algebra.DummyTable; 27 import org.xquark.extractor.algebra.Expression; 28 import org.xquark.extractor.runtime.IDProvider; 29 import org.xquark.extractor.sql.AbstractGenSqlVisitor; 30 import org.xquark.extractor.sql.SqlExpression; 31 import org.xquark.extractor.sql.SqlFactory; 32 33 public final class OracleGenSqlVisitor extends AbstractGenSqlVisitor { 34 35 private static final String RCSRevision = "$Revision: 1.9 $"; 36 private static final String RCSName = "$Name: $"; 37 38 public OracleGenSqlVisitor(IDProvider relIDProvider) { 39 super((SqlFactory) OracleFactory.getInstance(), relIDProvider); 40 } 41 42 public SqlExpression visit(BinOpArithmetic arg) { 43 45 SqlExpression retVal = null; 46 47 Expression aLOprnd = arg.getLeftOperand(); 48 SqlExpression sLOprnd = aLOprnd.accept(this); 49 50 Expression aROprnd = arg.getRightOperand(); 51 SqlExpression sROprnd = aROprnd.accept(this); 52 53 int oprtr = arg.getOperator(); 54 55 retVal = _factory.createBinOpArithmetic(oprtr, sLOprnd, sROprnd); 56 57 if (false 60 ) { 61 62 retVal = _factory.createSfRound(retVal); 63 } 64 65 return retVal; 67 } 68 69 protected org.xquark.extractor.sql.SqlSelect selectAddFromClause(org.xquark.extractor.sql.SqlSelect select, DummyTable operand) { 70 72 org.xquark.extractor.sql.SqlTable newFrom = _factory.createTable("dual"); 73 select.addFromClause(newFrom); 74 75 return select; 77 } 78 } 79 | Popular Tags |