public class P2JSQLServer2012Dialect extends P2JSQLServer2008Dialect
Note: this implementation expects a directory to be available at the time the class is loaded.
Dialect.WeightAggregatorindexFieldSizesCASE_TYPE_TOK, DEFAULT_MAX_WIDTH, SCALE_TOK| 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. |
void |
generateWordTablesDDLImpl(java.lang.String dbName,
java.io.PrintStream out,
java.lang.String eoln,
java.util.Collection<WordTable> wordTables)
Worker method for
generateTriggerDDLs(). |
java.lang.String |
getCreateSequenceString(java.lang.String name)
Generate a DDL string which will create a global sequence.
|
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()
Generate the appropriate select statement to retrieve the current value of a sequence.
|
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). |
java.lang.String |
id()
Get dialect id.
|
addRtrimmedExpression, blobCreator, buildRemoteURL, checkErrorFn, clobCreator, computeIndexKeySize, createContext, explicitSetCollation, extractColumnName, formatDate, getAnalyzeString, getComputedColumnFormula, getComputedColumnPrefix, getCreateIndexString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getDatabasePrepareStatements, getDelimiter, getDriverClassName, getDropIndexString, getDropIndexString, getDropTableString, getHighDate, getIndexLengthLimit, getJdbcDatabaseType, getLowDate, getMaxParameterCount, getProcessedCharacterColumnName, getScriptRunner, getSequenceSetValString, getSequenceSetValString, getSqlMappedType, getSyntheticIndexSize, initErrorFn, injectComputedColumns, inlineLimit, isCaseInsensitiveColumn, isComputedColumn, isConnectionError, isMetadataSortAsc, isMetadataSortDesc, isNativeUDFsSupported, isQueryRangeParameterInlined, isUdfOriginatedError, isUdfOriginatedWarning, isUniqueConstraintViolation, needsComputedColumns, prepareMetadataParameter, preparePermanentDatabase, processMetadataResult, requiresExplicitCastInsideTernary, scriptSplitter, supportsBooleanDatatype, supportsFunctionOverloading, useUdf4Contains, useWordTablesactivateErrorHandler, allowBindParamsInRecursiveCTE, allowDBUniqueCheck, allowSelectWildcard, beforeDriverLoad, checkIndexConstraints, connectionCustomizer, containsUdfName, dialects, errorEntry, getAddForeignKeyConstraintString, getCatalogPattern, getCodepage, getCollation, getComputedColumnString, getCreateIndexString, getCreateIndexString, getCreateSequenceString, getCreateTableString, getDecimals, getDialect, getDialect, getDialect, getInvisibleSpecificator, getLimitString, getMaxEntriesInSelect, getSchemaPattern, getSequenceSQL, getSpecificTypeAsString, getSqlIndexName, getSqlMappedType, isAutoCi, isAutoRtrim, isUdfContains, orderByNulls, postTransaction, preferDisjunctiveForm, quote, resetErrorHandler, resolveBooleanConstant, supportsLazyQueryResultsMode, supportsVariableLimit, translateToParmType, udfSchema, useCTE4Contains, useMixedNode4Contains, useNullEquality, weightAggregatorpublic 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)
getCreateSequenceString in class P2JSQLServer2008Dialectname - Sequence name.null if not supported.public java.lang.String getCreateSequenceString(java.lang.String name,
long start)
getCreateSequenceString in class P2JSQLServer2008Dialectname - 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 class P2JSQLServer2008Dialectname - 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 class P2JSQLServer2008Dialectname - The name of the sequence to be dropped.public java.lang.String getSequenceSetValString(java.lang.String sequenceName,
long newVal)
getSequenceSetValString in class P2JSQLServer2008DialectsequenceName - The name of the sequence.newVal - The new value to be set.public java.lang.String getSequenceCurrValString(java.lang.String sequenceName)
getSequenceCurrValString in class P2JSQLServer2008DialectsequenceName - The name of the sequence to be queried.public java.lang.String getSequenceCurrValString()
getSequenceCurrValString in class Dialectpublic java.lang.String getSequenceNextValString(java.lang.String sequenceName)
getSequenceNextValString in class P2JSQLServer2008DialectsequenceName - 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 class P2JSQLServer2008Dialecttrue because Server 2012 supports the concept of a SEQUENCE.public java.lang.String getSequencePrefetchString(java.lang.String sequenceName)
getSequencePrefetchString in class P2JSQLServer2008DialectsequenceName - 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 class P2JSQLServer2008DialectldbName - 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.
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.public java.lang.String id()
id in class P2JSQLServer2008Dialectpublic void generateWordTablesDDLImpl(java.lang.String dbName,
java.io.PrintStream out,
java.lang.String eoln,
java.util.Collection<WordTable> wordTables)
generateTriggerDDLs(). It generates the DDLs needed to create all
triggers in a database with a specific schema and using a certain dialect.generateWordTablesDDLImpl in class P2JSQLServer2008DialectdbName - The target schema.out - The PrintStream used for output.eoln - OS-specific end of line terminator.wordTables - word tables by name