net.sf.saffron.sql
Class SqlDialect

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

public class SqlDialect
extends Object

SqlDialect encapsulates the differences between dialects of SQL, for the benefit of a SqlWriter.


Field Summary
(package private)  String databaseProductName
           
(package private)  String identifierQuoteString
           
 
Constructor Summary
SqlDialect(DatabaseMetaData databaseMetaData)
          Creates a SqlDialect
 
Method Summary
protected  boolean allowsAs()
           
 boolean isAccess()
           
 boolean isOracle()
           
 boolean isPostgres()
           
 String quoteIdentifier(String val)
          Encloses an identifier in quotation marks appropriate for the current SQL dialect.
 String quoteStringLiteral(String val)
          Converts a string into a string literal.
protected  boolean requiresAliasForFromItems()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseProductName

String databaseProductName

identifierQuoteString

String identifierQuoteString
Constructor Detail

SqlDialect

public SqlDialect(DatabaseMetaData databaseMetaData)
Creates a SqlDialect

Parameters:
databaseMetaData - used to determine which dialect of SQL to generate
Method Detail

isAccess

public boolean isAccess()

isOracle

public boolean isOracle()

isPostgres

public boolean isPostgres()

quoteIdentifier

public String quoteIdentifier(String val)
Encloses an identifier in quotation marks appropriate for the current SQL dialect. For example, quoteIdentifier("emp") yields a string containing "emp" in Oracle, and a string containing [emp] in Access.


quoteStringLiteral

public String quoteStringLiteral(String val)
Converts a string into a string literal. For example, can't run becomes 'can''t run'.


allowsAs

protected boolean allowsAs()

requiresAliasForFromItems

protected boolean requiresAliasForFromItems()

SourceForge.net_Logo