saffron.util
Class SqlToOpenjavaConverter

java.lang.Object
  |
  +--saffron.util.SqlToOpenjavaConverter

public class SqlToOpenjavaConverter
extends Object

A SqlToOpenjavaConverter converts a tree of SqlNodes a ParseTree tree.

Since:
Mar 19, 2003
Version:
$Id: //open/saffron/src/main/saffron/util/SqlToOpenjavaConverter.java#4 $
Author:
jhyde

Nested Class Summary
static class SqlToOpenjavaConverter.SchemaCatalogReader
          A SchemaCatalogReader looks up catalog information from a saffron schema object.
(package private) static class SqlToOpenjavaConverter.TestContext
           
 
Field Summary
private static HashMap binaryMap
           
private static SqlToOpenjavaConverter.TestContext testContext
           
private  SqlValidator validator
           
 
Constructor Summary
(package private) SqlToOpenjavaConverter()
           
  SqlToOpenjavaConverter(SqlNode query, SqlValidator.CatalogReader catalogReader)
           
 
Method Summary
private  void check(TestCase test, String s)
           
private  Expression convertExpression(SqlValidator.Scope scope, SqlNode node)
           
private  Expression convertFrom(SqlValidator.Scope scope, SqlNode from)
           
private  ExpressionList convertGroup(SqlValidator.Scope scope, SqlNodeList groupList)
           
private  Expression convertIdentifier(SqlValidator.Scope scope, SqlIdentifier identifier)
          Converts an identifier into an expression in a given scope.
private static int convertJoinType(int joinType)
           
private  Expression convertLiteral(SqlLiteral literal)
           
private  ExpressionList convertOrder(SqlValidator.Scope scope, SqlNodeList orderList)
           
 Expression convertQuery(SqlNode query)
           
 Expression convertSelect(SqlSelect query)
           
private  ExpressionList convertSelectList(SqlValidator.SelectScope scope, SqlNodeList selectList)
           
private static HashMap createBinaryMap()
           
private  SqlToOpenjavaConverter.TestContext getTestContext()
           
private  void init(SqlNode query, SqlValidator.CatalogReader catalogReader)
           
static Test suite()
          Standard method recognised by JUnit.
 void testConvert(TestCase test)
           
 void testOrder(TestCase test)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validator

private SqlValidator validator

testContext

private static SqlToOpenjavaConverter.TestContext testContext

binaryMap

private static final HashMap binaryMap
Constructor Detail

SqlToOpenjavaConverter

SqlToOpenjavaConverter()

SqlToOpenjavaConverter

public SqlToOpenjavaConverter(SqlNode query,
                              SqlValidator.CatalogReader catalogReader)
Method Detail

init

private void init(SqlNode query,
                  SqlValidator.CatalogReader catalogReader)

convertQuery

public Expression convertQuery(SqlNode query)

convertSelect

public Expression convertSelect(SqlSelect query)

convertOrder

private ExpressionList convertOrder(SqlValidator.Scope scope,
                                    SqlNodeList orderList)

testOrder

public void testOrder(TestCase test)

check

private void check(TestCase test,
                   String s)

getTestContext

private SqlToOpenjavaConverter.TestContext getTestContext()

convertExpression

private Expression convertExpression(SqlValidator.Scope scope,
                                     SqlNode node)

createBinaryMap

private static HashMap createBinaryMap()

convertIdentifier

private Expression convertIdentifier(SqlValidator.Scope scope,
                                     SqlIdentifier identifier)
Converts an identifier into an expression in a given scope. For example, the "empno" in "select empno from emp join dept" becomes "emp.empno".


convertLiteral

private Expression convertLiteral(SqlLiteral literal)

testConvert

public void testConvert(TestCase test)

convertFrom

private Expression convertFrom(SqlValidator.Scope scope,
                               SqlNode from)

convertJoinType

private static int convertJoinType(int joinType)

convertGroup

private ExpressionList convertGroup(SqlValidator.Scope scope,
                                    SqlNodeList groupList)

convertSelectList

private ExpressionList convertSelectList(SqlValidator.SelectScope scope,
                                         SqlNodeList selectList)

suite

public static Test suite()
Standard method recognised by JUnit.


SourceForge.net_Logo