public class P2JSQLServer2012Dialect extends P2JSQLServer2008Dialect
Note: this implementation expects a directory to be available at the time the class is loaded.
Constructor and Description |
---|
P2JSQLServer2012Dialect() |
Modifier and Type | Method and Description |
---|---|
void |
applySqlLimit(int limit,
java.lang.StringBuilder buf,
int selectStartPos)
Given a string builder containing an SQL SELECT statement, a limit to apply, and the
position in the builder at which the SELECT statement begins, augment the SQL statement to
apply the given limit.
|
SequenceHandler |
createSequenceHandler(java.lang.String ldbName)
Creates and returns a
SequenceHandler for a SQL Server 2012 database. |
java.lang.String |
getCreateSequenceString(java.lang.String name,
long start)
Generate a DDL string which will create a global sequence with the given
starting value.
|
java.lang.String |
getCreateSequenceString(java.lang.String name,
java.lang.Long init,
java.lang.Long increment,
java.lang.Long minVal,
java.lang.Long maxVal,
java.lang.Boolean cycle)
Generate a DDL string which will create a sequence with given properties.
|
java.lang.String |
getDropSequenceString(java.lang.String name)
Generate a DDL string which will drop a sequence with given properties.
|
static java.util.List<java.lang.String> |
getReservedKeywords()
Get a collection of reserved keywords specific to this dialect.
|
java.lang.String |
getSequenceCurrValString(java.lang.String sequenceName)
Generate the appropriate select statement to retrieve the current value of a sequence.
|
java.lang.String |
getSequenceNextValString(java.lang.String sequenceName)
Generate the appropriate select statement to retrieve the next value of a sequence.
|
java.lang.String |
getSequencePrefetchString(java.lang.String sequenceName)
Generate the appropriate select statement to pre-fetch multiple, ascending values from a
sequence.
|
java.lang.String |
getSequenceSetValString(java.lang.String sequenceName,
long newVal)
Generate the appropriate select statement to reset the value of a sequence.
|
boolean |
hasFullSequenceSupport()
Returns
true if this dialect fully support the sequences as
4GL language (most important: bounded values, cycle). |
addRtrimmedExpression, beforeDriverLoad, buildRemoteURL, computeIndexKeySize, createContext, explicitSetCollation, extractColumnName, formatDate, getAlterComputedColumnString, getComputedColumnFormula, getComputedColumnPrefix, getCreateIndexString, getDatabasePrepareStatements, getDelimiter, getDropIndexString, getHighDate, getIndexLengthLimit, getLowDate, getMaxParameterCount, getProcessedCharacterColumnName, getSyntheticIndexSize, getTypeName, injectComputedColumns, inlineLimit, isCaseInsensitiveColumn, isComputedColumn, isConnectionError, isMetadataSortAsc, isMetadataSortDesc, isQueryRangeParameterInlined, needsComputedColumns, postTransaction, prepareMetadataParameter, processMetadataResult, requiresExplicitCastInsideTernary, supportsBooleanDatatype, supportsFunctionOverloading
appendLockHint, buildLimitHandler, buildSQLExceptionConversionDelegate
appendIdentitySelectToInsert, areStringComparisonsCaseInsensitive, closeQuote, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, getCurrentTimestampSelectString, getInExpressionCountLimit, getLimitString, getNoColumnsInsertString, getSqlTypeDescriptorOverride, openQuote, supportsCircularCascadeDeleteConstraints, supportsLimit, supportsLimitOffset, supportsLobValueChangePropogation, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsVariableLimit, useMaxForLimit
appendLockHint, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, cast, cast, cast, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, dropConstraints, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getDropTemporaryTableString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getQuerySequencesString, getReadLockString, getSelectClauseNullString, getSelectSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getViolatedConstraintNameExtracter, getWriteLockString, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isLockTimeoutParameterized, performTemporaryTableDDLInIsolation, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, remapSqlTypeDescriptor, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsColumnCheck, supportsCommentOn, supportsExpectedLobUsagePattern, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsLockTimeouts, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
quote
public static java.util.List<java.lang.String> getReservedKeywords()
NameConverter
uses thes list to create an exclusion
list of names so there will not be schema collisions with identifiers (tables, fields) from
the generated schema.public java.lang.String getCreateSequenceString(java.lang.String name, long start)
getCreateSequenceString
in interface P2JDialect
getCreateSequenceString
in class P2JSQLServer2008Dialect
name
- Sequence name.start
- Sequence starting value.public java.lang.String getCreateSequenceString(java.lang.String name, java.lang.Long init, java.lang.Long increment, java.lang.Long minVal, java.lang.Long maxVal, java.lang.Boolean cycle)
getCreateSequenceString
in interface P2JDialect
getCreateSequenceString
in class P2JSQLServer2008Dialect
name
- Sequence name. Mandatory not null.init
- Sequence starting value. Mandatory(not null).increment
- Sequence incrementing value. Mandatory(not null).minVal
- Sequence minimum value. Optional (may be null).maxVal
- Sequence maximum value. Optional (may be null).cycle
- Sequence cycling property. Optional, if missing assumed not cycling.public java.lang.String getDropSequenceString(java.lang.String name)
getDropSequenceString
in interface P2JDialect
getDropSequenceString
in class P2JSQLServer2008Dialect
name
- The name of the sequence to be dropped.public java.lang.String getSequenceSetValString(java.lang.String sequenceName, long newVal)
getSequenceSetValString
in interface P2JDialect
getSequenceSetValString
in class P2JSQLServer2008Dialect
sequenceName
- The name of the sequence.newVal
- The new value to be set.public java.lang.String getSequenceCurrValString(java.lang.String sequenceName)
getSequenceCurrValString
in interface P2JDialect
getSequenceCurrValString
in class P2JSQLServer2008Dialect
sequenceName
- The name of the sequence to be queried.public java.lang.String getSequenceNextValString(java.lang.String sequenceName)
getSequenceNextValString
in interface P2JDialect
getSequenceNextValString
in class org.hibernate.dialect.Dialect
sequenceName
- The name of the sequence.public boolean hasFullSequenceSupport()
true
if this dialect fully support the sequences as
4GL language (most important: bounded values, cycle). If not fully
supported, additional code is needed in P2J sequence class
implementation to fix this.hasFullSequenceSupport
in interface P2JDialect
hasFullSequenceSupport
in class P2JSQLServer2008Dialect
true
because Server 2012 supports the concept of a SEQUENCE.public java.lang.String getSequencePrefetchString(java.lang.String sequenceName)
getSequencePrefetchString
in interface P2JDialect
getSequencePrefetchString
in class P2JSQLServer2008Dialect
sequenceName
- The name of the sequence from which the values are to be retrieved.null
if this feature is not supported
by the dialect.public SequenceHandler createSequenceHandler(java.lang.String ldbName)
SequenceHandler
for a SQL Server 2012 database.createSequenceHandler
in interface P2JDialect
createSequenceHandler
in class P2JSQLServer2008Dialect
ldbName
- The logical name of the database to create the SequenceHandler
for.SQLServer2012SequenceHandler
instance.public void applySqlLimit(int limit, java.lang.StringBuilder buf, int selectStartPos)
This method is intended to be used only in the specialized case of a well-known subquery which always begins with the SELECT keyword and always ends with an ORDER BY clause.
This implementation inserts top
keyword, followed by the given numeric limit,
immediately after the SELECT keyword.
applySqlLimit
in class org.hibernate.dialect.Dialect
limit
- Maximum number of records to return.buf
- String builder containing the select statement. At the time this method is
invoked, the builder will contain a statement which always will begin with the
SELECT keyword and will end with an ORDER BY clause.selectStartPos
- Zero-based index position in the string builder of the first character of the
SELECT keyword.