org.apache.lucene.store.jdbc.dialect
Class Dialect

java.lang.Object
  extended by org.apache.lucene.store.jdbc.dialect.Dialect
Direct Known Subclasses:
DB2Dialect, H2Dialect, HSQLDialect, InterbaseDialect, MySQLDialect, OracleDialect, PostgreSQLDialect, SybaseDialect

public abstract class Dialect
extends Object

A database specific abstraction. All other dialects must extend this Dialect.

Author:
kimchy

Constructor Summary
Dialect()
           
 
Method Summary
 String closeBlobSelectQuote()
          Some database require quoting the blob in selects
 char closeQuote()
          The closing quote for a quoted identifier .
abstract  String getBitType()
          The database BIT type.
abstract  String getBlobType(long length)
          The database blob type for the given length.
 String getCascadeConstraintsString()
          Completely optional cascading drop clause
abstract  String getCurrentTimestampFunction()
          The database current timestamp function that is used with several sql updates.
 String getCurrentTimestampSelectString()
          The database current time stamp select query.
 String getForUpdateNowaitString()
          Does this dialect support the Oracle-style FOR UPDATE NOWAIT syntax?
 String getForUpdateString()
          Does this dialect support the FOR UPDATE syntax?
abstract  String getNumberType()
          The database number type.
 String getTableTypeString()
          The type of the table that is created.
abstract  String getTimestampType()
          The database TIMESTAMP type.
abstract  String getVarcharType(int length)
          The database varchar type for the given length.
 boolean isCurrentTimestampSelectStringCallable()
          If the current timestamp select queyr is a callable query or not.
 String openBlobSelectQuote()
          Some database require quoting the blob in selects
 char openQuote()
          The opening quote for a quoted identifier.
 void processSettings(JdbcDirectorySettings settings)
          Process settings and apply any dialect related changes.
 String sqlTableExists(String catalog, String schemaName)
          If the dialect support a special query to check if a table exists, the actual sql that is used to perform it.
 boolean supportsCurrentTimestampSelection()
          Does the database supports a query for the current timestamp.
abstract  boolean supportsForUpdate()
          Does the database supports select ... for update sql clause?
 boolean supportsIfExistsAfterTableName()
          Does the database support "if exists" after the table name when constructing a sql drop for the table.
 boolean supportsIfExistsBeforeTableName()
          Does the database support "if exists" before the table name when constructing a sql drop for the table.
 boolean supportsTableExists()
          Does the dialect support a special query to check if a table exists.
 boolean supportTransactionalScopedBlobs()
          Does the database (or the jdbc driver) supports transactional blob.
 boolean useExistsBeforeInsertLock()
          Do we need to perform a special check to see if the lock already exists in the database, or should we try and insert it without checking.
 boolean useInputStreamToInsertBlob()
          Does the database require using an InputStream to insert a blob, or the setBlob method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dialect

public Dialect()
Method Detail

processSettings

public void processSettings(JdbcDirectorySettings settings)
Process settings and apply any dialect related changes. Defaults to do nothing.


supportTransactionalScopedBlobs

public boolean supportTransactionalScopedBlobs()
Does the database (or the jdbc driver) supports transactional blob. Is so, can be used with the FetchPerTransactionJdbcIndexInput. Defaults to false.


supportsIfExistsBeforeTableName

public boolean supportsIfExistsBeforeTableName()
Does the database support "if exists" before the table name when constructing a sql drop for the table. Defaults to false.


supportsIfExistsAfterTableName

public boolean supportsIfExistsAfterTableName()
Does the database support "if exists" after the table name when constructing a sql drop for the table. Defaults to false.


supportsTableExists

public boolean supportsTableExists()
Does the dialect support a special query to check if a table exists. Defaults to false.


sqlTableExists

public String sqlTableExists(String catalog,
                             String schemaName)
If the dialect support a special query to check if a table exists, the actual sql that is used to perform it. Defaults to throw an Unsupported excetion (see supportsTableExists().


useInputStreamToInsertBlob

public boolean useInputStreamToInsertBlob()
Does the database require using an InputStream to insert a blob, or the setBlob method. Defaults to true.


useExistsBeforeInsertLock

public boolean useExistsBeforeInsertLock()
Do we need to perform a special check to see if the lock already exists in the database, or should we try and insert it without checking. Defaults to true.


openQuote

public char openQuote()
The opening quote for a quoted identifier. Defaults to ".


closeQuote

public char closeQuote()
The closing quote for a quoted identifier . Defaults to ".


openBlobSelectQuote

public String openBlobSelectQuote()
Some database require quoting the blob in selects


closeBlobSelectQuote

public String closeBlobSelectQuote()
Some database require quoting the blob in selects


getCascadeConstraintsString

public String getCascadeConstraintsString()
Completely optional cascading drop clause


supportsForUpdate

public abstract boolean supportsForUpdate()
Does the database supports select ... for update sql clause?


getForUpdateString

public String getForUpdateString()
Does this dialect support the FOR UPDATE syntax? Defaults to for update.


getForUpdateNowaitString

public String getForUpdateNowaitString()
Does this dialect support the Oracle-style FOR UPDATE NOWAIT syntax? Defaults to getForUpdateString().


getTableTypeString

public String getTableTypeString()
The type of the table that is created. Defaults to an empty string.


supportsCurrentTimestampSelection

public boolean supportsCurrentTimestampSelection()
Does the database supports a query for the current timestamp. Defaults to false.


getCurrentTimestampSelectString

public String getCurrentTimestampSelectString()
The database current time stamp select query.


isCurrentTimestampSelectStringCallable

public boolean isCurrentTimestampSelectStringCallable()
If the current timestamp select queyr is a callable query or not.


getCurrentTimestampFunction

public abstract String getCurrentTimestampFunction()
The database current timestamp function that is used with several sql updates.


getVarcharType

public abstract String getVarcharType(int length)
The database varchar type for the given length. The length is in chars.


getBlobType

public abstract String getBlobType(long length)
The database blob type for the given length. The length is in KB.


getNumberType

public abstract String getNumberType()
The database number type.


getTimestampType

public abstract String getTimestampType()
The database TIMESTAMP type.


getBitType

public abstract String getBitType()
The database BIT type.



Copyright (c) 2004-2008 The Compass Project.