br.com.arsmachina.dao.hibernate.dialect
Class IdentityPostresqlDialect

java.lang.Object
  extended by org.hibernate.dialect.Dialect
      extended by org.hibernate.dialect.PostgreSQLDialect
          extended by br.com.arsmachina.dao.hibernate.dialect.IdentityPostresqlDialect

public class IdentityPostresqlDialect
extends org.hibernate.dialect.PostgreSQLDialect

PostgreSQLDialect that defines IdentityGenerator as the default id value generator instead of SequenceGenerator. In addition, it fixes the "wrong sequence name in backticks-scaped table name bug".

Author:
Thiago H. de Paula Figueiredo

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE
 
Constructor Summary
IdentityPostresqlDialect()
           
 
Method Summary
 String getIdentitySelectString(String table, String column, int type)
          Removes the backtickes from the sequenceName and then returns super.getSequenceNextValString(sequenceName).
 Class getNativeIdentifierGeneratorClass()
          Returns IdentityGenerator instead of SequenceGenerator.
 
Methods inherited from class org.hibernate.dialect.PostgreSQLDialect
bindLimitParametersInReverseOrder, dropConstraints, getAddColumnString, getCascadeConstraintsString, getCreateSequenceString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCurrentTimestampSelectString, getDropSequenceString, getForUpdateString, getIdentityColumnString, getLimitString, getNoColumnsInsertString, getQuerySequencesString, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceNextValString, getViolatedConstraintNameExtracter, hasDataTypeInIdentityColumn, isCurrentTimestampSelectStringCallable, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExpectedLobUsagePattern, supportsIdentityColumns, supportsLimit, supportsOuterJoinForUpdate, supportsSequences, supportsTemporaryTables, supportsUnionAll, toBooleanValueString, useInputStreamToInsertBlob
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, buildSQLExceptionConverter, closeQuote, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropTemporaryTableAfterUse, forUpdateOfColumns, generateTemporaryTableName, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCastTypeName, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getKeywords, getLimitString, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNullColumnString, getResultSet, getSelectGUIDString, getTableComment, getTableTypeString, getTypeName, getTypeName, hasAlterTable, hasSelfReferentialForeignKeyBug, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExistsInSelect, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsLobValueChangePropogation, supportsNotNullUnique, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toString, transformSelectString, useMaxForLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentityPostresqlDialect

public IdentityPostresqlDialect()
Method Detail

getNativeIdentifierGeneratorClass

public Class getNativeIdentifierGeneratorClass()
Returns IdentityGenerator instead of SequenceGenerator.

Overrides:
getNativeIdentifierGeneratorClass in class org.hibernate.dialect.PostgreSQLDialect
See Also:
PostgreSQLDialect.getNativeIdentifierGeneratorClass()

getIdentitySelectString

public String getIdentitySelectString(String table,
                                      String column,
                                      int type)
Removes the backtickes from the sequenceName and then returns super.getSequenceNextValString(sequenceName).

Overrides:
getIdentitySelectString in class org.hibernate.dialect.PostgreSQLDialect
See Also:
PostgreSQLDialect.getSequenceNextValString(java.lang.String)


Copyright © 2008-2009 Thiago H. de Paula Figueiredo. All Rights Reserved.