net.sf.saffron.sql
Class SqlWriter

java.lang.Object
  |
  +--net.sf.saffron.sql.SqlWriter

public class SqlWriter
extends Object

A SqlWriter is the target to construct a SQL statement from a parse tree. It deals with dialect differences; for example, Oracle quotes identifiers as "scott", while SQL Server quotes them as [scott].


Field Summary
(package private) static boolean alwaysUseParentheses
           
 SqlDialect dialect
           
private  PrintWriter pw
           
(package private)  SqlSelect query
           
(package private)  Stack queryStack
           
 
Constructor Summary
SqlWriter(SqlDialect dialect, PrintWriter pw)
           
 
Method Summary
 SqlSelect getQuery()
           
 void popQuery(SqlSelect query)
           
 void print(char x)
           
 void print(int x)
           
 void print(String s)
           
 void printIdentifier(String name)
           
 void println()
           
 void pushQuery(SqlSelect query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alwaysUseParentheses

static final boolean alwaysUseParentheses
See Also:
Constant Field Values

dialect

public final SqlDialect dialect

query

SqlSelect query

queryStack

Stack queryStack

pw

private PrintWriter pw
Constructor Detail

SqlWriter

public SqlWriter(SqlDialect dialect,
                 PrintWriter pw)
Method Detail

popQuery

public void popQuery(SqlSelect query)

pushQuery

public void pushQuery(SqlSelect query)

print

public void print(String s)

print

public void print(char x)

print

public void print(int x)

printIdentifier

public void printIdentifier(String name)

println

public void println()

getQuery

public SqlSelect getQuery()

SourceForge.net_Logo