net.sf.dewdrop.sql.dialect
Class Dialect

java.lang.Object
  extended bynet.sf.dewdrop.sql.dialect.Dialect
Direct Known Subclasses:
GenericDialect

public abstract class Dialect
extends Object

Author:
Les Hazlewood

Field Summary
protected static String DEFAULT_CHAR_TOKEN
           
static Dialect DEFAULT_DIALECT
           
protected static String DEFAULT_NUMERIC_TOKEN
           
protected static String DEFAULT_VARBINARY_TOKEN
           
protected static String DEFAULT_VARCHAR_TOKEN
           
 
Constructor Summary
protected Dialect()
           
 
Method Summary
 boolean equals(Object o)
           
 String getCloseQuote()
          Returns the closing delimiter for a quoted literal string.
static Dialect getDialect(String dialectName)
           
 String getName()
          Returns the name of this dialect.
 String getOpenQuote()
          Returns the opening delimiter for a quoted literal string.
 String getTypeString(SqlDataType type)
          Get the name of the database type associated with the given SqlDataType.
 String getTypeString(SqlDataType type, int length, int precision)
          Get the name of the database type associated with the given SqlDataType.
protected  void registerColumnType(SqlDataType type, int capacity, String name)
          Subclasses register a typename for the given type code and maximum column length.
protected  void registerColumnType(SqlDataType type, String name)
          Subclasses register a typename for the given type code.
 boolean supportsSequences()
          Returns whether or not this SQL Dialect supports sequences.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DIALECT

public static final Dialect DEFAULT_DIALECT

DEFAULT_CHAR_TOKEN

protected static final String DEFAULT_CHAR_TOKEN
See Also:
Constant Field Values

DEFAULT_VARCHAR_TOKEN

protected static final String DEFAULT_VARCHAR_TOKEN
See Also:
Constant Field Values

DEFAULT_VARBINARY_TOKEN

protected static final String DEFAULT_VARBINARY_TOKEN
See Also:
Constant Field Values

DEFAULT_NUMERIC_TOKEN

protected static final String DEFAULT_NUMERIC_TOKEN
See Also:
Constant Field Values
Constructor Detail

Dialect

protected Dialect()
Method Detail

getName

public String getName()
Returns the name of this dialect.


getTypeString

public String getTypeString(SqlDataType type)
                     throws DialectException
Get the name of the database type associated with the given SqlDataType.

Parameters:
type - Sql data type
Returns:
the database type string for the specified type
Throws:
DialectException - if this Dialect does not support the specified type.

getTypeString

public String getTypeString(SqlDataType type,
                            int length,
                            int precision)
                     throws DialectException
Get the name of the database type associated with the given SqlDataType.

Parameters:
type - Sql data type
length - the length or size of the column
precision - the precision/scale of the column
Returns:
the database type name
Throws:
DialectException

registerColumnType

protected void registerColumnType(SqlDataType type,
                                  int capacity,
                                  String name)
Subclasses register a typename for the given type code and maximum column length. $l in the type name with be replaced by the column length (if appropriate).

Parameters:
type - Sql data type
capacity - maximum length of database type
name - the database type name

registerColumnType

protected void registerColumnType(SqlDataType type,
                                  String name)
Subclasses register a typename for the given type code. $l in the type name with be replaced by the column length (if appropriate).

Parameters:
type - Sql data type
name - the database type name

supportsSequences

public boolean supportsSequences()
Returns whether or not this SQL Dialect supports sequences.


getOpenQuote

public String getOpenQuote()
Returns the opening delimiter for a quoted literal string.


getCloseQuote

public String getCloseQuote()
Returns the closing delimiter for a quoted literal string.


equals

public boolean equals(Object o)

getDialect

public static Dialect getDialect(String dialectName)

toString

public String toString()