org.hibernate.dialect
Class PostgreSQLDialect

java.lang.Object
  extended byorg.hibernate.dialect.Dialect
      extended byorg.hibernate.dialect.PostgreSQLDialect

public class PostgreSQLDialect
extends Dialect

An SQL dialect for Postgres

Author:
Gavin King

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, QUOTE
 
Constructor Summary
PostgreSQLDialect()
           
 
Method Summary
 boolean bindLimitParametersInReverseOrder()
          Does the LIMIT clause specify arguments in the "reverse" order limit, offset instead of offset, limit?
 boolean dropConstraints()
          Do we need to drop constraints before dropping tables in this dialect?
 String getAddColumnString()
          The syntax used to add a column to a table (optional).
 String getCascadeConstraintsString()
          Completely optional cascading drop clause
 String getCreateSequenceString(String sequenceName)
          The syntax used to create a sequence, if sequences are supported.
 String getDropSequenceString(String sequenceName)
          The syntax used to drop a sequence, if sequences are supported.
 String getForUpdateString(String aliases)
          Does this dialect support the FOR UPDATE OF syntax?
 String getIdentityColumnString(int type)
          The keyword used to specify an identity column, if identity column key generation is supported.
 String getIdentitySelectString(String table, String column, int type)
          The syntax that returns the identity value of the last insert, if identity column key generation is supported.
 String getLimitString(String sql, boolean hasOffset)
          Add a LIMIT clause to the given SQL SELECT
 Class getNativeIdentifierGeneratorClass()
           
 String getNoColumnsInsertString()
          The keyword used to insert a row without specifying any column values
 String getQuerySequencesString()
          A query used to find all sequences
 String getSelectClauseNullString(int sqlType)
          Workaround for postgres bug #1453
 String getSequenceNextValString(String sequenceName)
          The syntax that fetches the next value of a sequence, if sequences are supported.
 boolean hasDataTypeInIdentityColumn()
          Whether this dialect have an Identity clause added to the data type or a completely seperate identity data type
 boolean supportsCommentOn()
           
 boolean supportsIdentityColumns()
          Does this dialect support identity column key generation?
 boolean supportsLimit()
          Does this Dialect have some kind of LIMIT syntax?
 boolean supportsOuterJoinForUpdate()
           
 boolean supportsSequences()
          Does this dialect support sequences?
 boolean supportsUnionAll()
           
 boolean useInputStreamToInsertBlob()
           
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, bindLimitParametersFirst, buildSQLExceptionConverter, closeQuote, createCaseFragment, createOuterJoinFragment, forUpdateOfColumns, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getColumnComment, getCreateSequenceStrings, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getFunctions, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getLimitString, getLowercaseFunction, getNullColumnString, getResultSet, getSchemaSeparator, getSelectGUIDString, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasSelfReferentialForeignKeyBug, openQuote, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerResultSetOutParameter, supportsCascadeDelete, supportsColumnCheck, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsNotNullUnique, supportsTableCheck, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toString, useMaxForLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PostgreSQLDialect

public PostgreSQLDialect()
Method Detail

getAddColumnString

public String getAddColumnString()
Description copied from class: Dialect
The syntax used to add a column to a table (optional).

Overrides:
getAddColumnString in class Dialect

getSequenceNextValString

public String getSequenceNextValString(String sequenceName)
Description copied from class: Dialect
The syntax that fetches the next value of a sequence, if sequences are supported.

Overrides:
getSequenceNextValString in class Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

getCreateSequenceString

public String getCreateSequenceString(String sequenceName)
Description copied from class: Dialect
The syntax used to create a sequence, if sequences are supported.

Overrides:
getCreateSequenceString in class Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

getDropSequenceString

public String getDropSequenceString(String sequenceName)
Description copied from class: Dialect
The syntax used to drop a sequence, if sequences are supported.

Overrides:
getDropSequenceString in class Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

getCascadeConstraintsString

public String getCascadeConstraintsString()
Description copied from class: Dialect
Completely optional cascading drop clause

Overrides:
getCascadeConstraintsString in class Dialect
Returns:
String

dropConstraints

public boolean dropConstraints()
Description copied from class: Dialect
Do we need to drop constraints before dropping tables in this dialect?

Overrides:
dropConstraints in class Dialect
Returns:
boolean

supportsSequences

public boolean supportsSequences()
Description copied from class: Dialect
Does this dialect support sequences?

Overrides:
supportsSequences in class Dialect
Returns:
boolean

getQuerySequencesString

public String getQuerySequencesString()
Description copied from class: Dialect
A query used to find all sequences

Overrides:
getQuerySequencesString in class Dialect
See Also:
SchemaUpdate

supportsLimit

public boolean supportsLimit()
Description copied from class: Dialect
Does this Dialect have some kind of LIMIT syntax?

Overrides:
supportsLimit in class Dialect

getLimitString

public String getLimitString(String sql,
                             boolean hasOffset)
Description copied from class: Dialect
Add a LIMIT clause to the given SQL SELECT

Overrides:
getLimitString in class Dialect
Returns:
the modified SQL

bindLimitParametersInReverseOrder

public boolean bindLimitParametersInReverseOrder()
Description copied from class: Dialect
Does the LIMIT clause specify arguments in the "reverse" order limit, offset instead of offset, limit?

Overrides:
bindLimitParametersInReverseOrder in class Dialect
Returns:
true if the correct order is limit, offset

supportsIdentityColumns

public boolean supportsIdentityColumns()
Description copied from class: Dialect
Does this dialect support identity column key generation?

Overrides:
supportsIdentityColumns in class Dialect
Returns:
boolean

getForUpdateString

public String getForUpdateString(String aliases)
Description copied from class: Dialect
Does this dialect support the FOR UPDATE OF syntax?

Overrides:
getForUpdateString in class Dialect
Returns:
boolean

getIdentitySelectString

public String getIdentitySelectString(String table,
                                      String column,
                                      int type)
Description copied from class: Dialect
The syntax that returns the identity value of the last insert, if identity column key generation is supported.

Overrides:
getIdentitySelectString in class Dialect
Parameters:
type - TODO

getIdentityColumnString

public String getIdentityColumnString(int type)
Description copied from class: Dialect
The keyword used to specify an identity column, if identity column key generation is supported.

Overrides:
getIdentityColumnString in class Dialect
Parameters:
type - the SQL column type, as defined by java.sql.Types

hasDataTypeInIdentityColumn

public boolean hasDataTypeInIdentityColumn()
Description copied from class: Dialect
Whether this dialect have an Identity clause added to the data type or a completely seperate identity data type

Overrides:
hasDataTypeInIdentityColumn in class Dialect
Returns:
boolean

getNoColumnsInsertString

public String getNoColumnsInsertString()
Description copied from class: Dialect
The keyword used to insert a row without specifying any column values

Overrides:
getNoColumnsInsertString in class Dialect

getNativeIdentifierGeneratorClass

public Class getNativeIdentifierGeneratorClass()
Overrides:
getNativeIdentifierGeneratorClass in class Dialect

supportsOuterJoinForUpdate

public boolean supportsOuterJoinForUpdate()
Overrides:
supportsOuterJoinForUpdate in class Dialect

useInputStreamToInsertBlob

public boolean useInputStreamToInsertBlob()
Overrides:
useInputStreamToInsertBlob in class Dialect

supportsUnionAll

public boolean supportsUnionAll()
Overrides:
supportsUnionAll in class Dialect

getSelectClauseNullString

public String getSelectClauseNullString(int sqlType)
Workaround for postgres bug #1453

Overrides:
getSelectClauseNullString in class Dialect

supportsCommentOn

public boolean supportsCommentOn()
Overrides:
supportsCommentOn in class Dialect