- java.lang.Object
-
- org.tentackle.sql.AbstractBackend
-
- org.tentackle.sql.AbstractSql92Backend
-
- org.tentackle.sql.AbstractSql2003Backend
-
- All Implemented Interfaces:
Backend
- Direct Known Subclasses:
AbstractSql2008Backend,Db2,Ingres,MsSql,Oracle
public abstract class AbstractSql2003Backend extends AbstractSql92Backend
Common to all SQL2003 backends.- Author:
- harald
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]RESERVED_WORDS_SQL2003array of additional reserved words.static java.lang.StringSQL_WINDOW_1window function part 1.static java.lang.StringSQL_WINDOW_2window function part 2.static java.lang.StringSQL_WINDOW_LIMITcondition for limit and offset.static java.lang.StringSQL_WINDOW_OFFSETcondition for limit and offset.-
Fields inherited from class org.tentackle.sql.AbstractSql92Backend
RESERVED_WORDS_SQL92, SQL_COALESCE, SQL_FOR_UPDATE
-
Fields inherited from class org.tentackle.sql.AbstractBackend
TYPE_BIGINT, TYPE_BIT, TYPE_BLOB, TYPE_BOOL, TYPE_BOOLEAN, TYPE_BYTE, TYPE_BYTEA, TYPE_CHAR_1, TYPE_CLOB, TYPE_DATE, TYPE_DATETIME, TYPE_DATETIME_YEAR_TO_SECOND, TYPE_DECIMAL, TYPE_DECIMAL_19, TYPE_DOUBLE, TYPE_FLOAT, TYPE_FLOAT4, TYPE_FLOAT8, TYPE_INT, TYPE_INT2, TYPE_INT4, TYPE_INT8, TYPE_INTEGER, TYPE_NCHAR_1, TYPE_NUMBER, TYPE_NUMBER_1, TYPE_NUMBER_10, TYPE_NUMBER_19, TYPE_NUMBER_5, TYPE_NVARCHAR, TYPE_NVARCHAR_MAX, TYPE_REAL, TYPE_SMALLFLOAT, TYPE_SMALLINT, TYPE_TEXT, TYPE_TIME, TYPE_TIMESTAMP, TYPE_TINYINT, TYPE_VARBINARY_MAX, TYPE_VARCHAR
-
Fields inherited from interface org.tentackle.sql.Backend
SQL_ALLSTAR, SQL_ALTER_COLUMN, SQL_ALTER_INDEX, SQL_ALTER_TABLE, SQL_AND, SQL_ANDNOT, SQL_COMMA, SQL_COMMA_PAR, SQL_DELETE, SQL_EQUAL, SQL_EQUAL_PAR, SQL_EQUAL_PAR_COMMA, SQL_EQUAL_ZERO, SQL_EXISTS, SQL_FROM, SQL_GREATER, SQL_GREATER_PAR, SQL_GREATEROREQUAL, SQL_GREATEROREQUAL_PAR, SQL_GROUPBY, SQL_IF_EXISTS, SQL_INSERT_INTO, SQL_INSERT_VALUES, SQL_ISNOTNULL, SQL_ISNULL, SQL_LEFT_PARENTHESIS, SQL_LESS, SQL_LESS_PAR, SQL_LESSOREQUAL, SQL_LESSOREQUAL_PAR, SQL_LIKE, SQL_LIKE_PAR, SQL_MAX, SQL_MIN, SQL_NOT, SQL_NOTEQUAL, SQL_NOTEQUAL_PAR, SQL_NOTEQUAL_ZERO, SQL_NOTLIKE, SQL_NOTLIKE_PAR, SQL_OR, SQL_ORDERBY, SQL_ORNOT, SQL_PAR, SQL_PAR_COMMA, SQL_PLUS_ONE, SQL_RIGHT_PARENTHESIS, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SET, SQL_SORTASC, SQL_SORTDESC, SQL_UPDATE, SQL_WHERE, SQL_WHEREALL, SQL_WHEREAND, SQL_WHERENOTHING, SQL_WHEREOR
-
-
Constructor Summary
Constructors Constructor Description AbstractSql2003Backend()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildSelectSql(java.lang.StringBuilder sqlBuilder, boolean writeLock, int limit, int offset)Creates a select statement string from an inner sql string.java.util.Set<java.lang.String>getReservedWords()Gets the list of reserved words for this backend.intsetLeadingSelectParameters(BackendPreparedStatement stmt, int limit, int offset)Sets optional parameters before applying the original parameters.intsetTrailingSelectParameters(BackendPreparedStatement stmt, int index, int limit, int offset)Sets optional parameters after applying the original parameters.java.lang.StringsqlNextFromSequene(java.lang.String name)Creates the SQL string to retrieve the next id from a sequence.booleansupportsSequences()True if backend provides transactionless sequences.-
Methods inherited from class org.tentackle.sql.AbstractSql92Backend
getCoalesceKeyword, sqlCreateForeignKey, sqlDropForeignKey
-
Methods inherited from class org.tentackle.sql.AbstractBackend
allowsExpressionsReferringToTablesBeingUpdated, assertValidName, buildSelectSql, columnTypeNullDefaultToString, columnTypeToString, createColumnMetaData, createConnection, createIndexColumnMetaData, createIndexMetaData, createPassword, createTableMetaData, extractWhereClause, getDefaultSchema, getDefaultSize, getEmptyString, getMaxScale, getMaxSize, getMetaData, getMigrationStrategy, getModelMetaData, getTableHeaders, getTableMetaData, isClobSupported, isCommunicationLinkException, isConstraintException, isDefaultEqual, isDropIfExistsEnabled, isDropIfExistsSupported, isFilteredIndexSupported, isFunctionBasedIndexSupported, isMatchingName, isReleaseSavepointSupported, isReservedSchemaName, isReservedTableName, isTemporaryName, jdbcTypeToSqlType, needAliasForSubselect, needSetLongWorkaround, needTxForFetchsize, normalizeDefault, optimizeSql, setDropIfExistsEnabled, sqlAddColumn, sqlAlterColumnComment, sqlAlterColumnDefault, sqlAlterColumnNullConstraint, sqlAlterColumnType, sqlAlterTableComment, sqlAsBeforeTableAlias, sqlComment, sqlCreateColumn, sqlCreateColumnComment, sqlCreateIndex, sqlCreateTableAttributeWithoutComment, sqlCreateTableClosing, sqlCreateTableComment, sqlCreateTableIntro, sqlCreateTableIntroWithoutComment, sqlDropColumn, sqlDropIndex, sqlDropTable, sqlFunction, sqlJoin, sqlJoinSelects, sqlJoinSelects, sqlRenameAndAlterColumnType, sqlRenameColumn, sqlRenameIndex, sqlRenameTable, sqlRequiresExtraCommit, sqlResultSetIsClosedSupported, sqlTypeToString, sqlUpdateToNotNull, toQuotedString, toString, valueToLiteral
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tentackle.sql.Backend
getBackendId, getDriverClassName, getName, isMatchingUrl
-
-
-
-
Field Detail
-
SQL_WINDOW_1
public static final java.lang.String SQL_WINDOW_1
window function part 1.- See Also:
- Constant Field Values
-
SQL_WINDOW_2
public static final java.lang.String SQL_WINDOW_2
window function part 2.- See Also:
- Constant Field Values
-
SQL_WINDOW_LIMIT
public static final java.lang.String SQL_WINDOW_LIMIT
condition for limit and offset.- See Also:
- Constant Field Values
-
SQL_WINDOW_OFFSET
public static final java.lang.String SQL_WINDOW_OFFSET
condition for limit and offset.- See Also:
- Constant Field Values
-
RESERVED_WORDS_SQL2003
public static final java.lang.String[] RESERVED_WORDS_SQL2003
array of additional reserved words.
-
-
Method Detail
-
getReservedWords
public java.util.Set<java.lang.String> getReservedWords()
Description copied from interface:BackendGets the list of reserved words for this backend.- Specified by:
getReservedWordsin interfaceBackend- Overrides:
getReservedWordsin classAbstractSql92Backend- Returns:
- the list of reserved words
-
buildSelectSql
public void buildSelectSql(java.lang.StringBuilder sqlBuilder, boolean writeLock, int limit, int offset)Description copied from interface:BackendCreates a select statement string from an inner sql string.sqlBuilderis anything asFROM... WHERE... ORDER BY....
It is decorated with a leadingSELECTplus optional clauses like for the given parameters.- Specified by:
buildSelectSqlin interfaceBackend- Overrides:
buildSelectSqlin classAbstractSql92Backend- Parameters:
sqlBuilder- the sql builder, initially containing the inner sql without leadingSELECT.writeLock- true select should write locklimit- the limit value, ≤ 0 if no limit clauseoffset- the offset value, ≤ 0 if no offset clause
-
setLeadingSelectParameters
public int setLeadingSelectParameters(BackendPreparedStatement stmt, int limit, int offset)
Description copied from interface:BackendSets optional parameters before applying the original parameters.- Specified by:
setLeadingSelectParametersin interfaceBackend- Overrides:
setLeadingSelectParametersin classAbstractSql92Backend- Parameters:
stmt- the prepared statementlimit- the limit value, ≤ 0 if no limit clauseoffset- the offset value, ≤ 0 if no offset clause- Returns:
- the next parameter index
-
setTrailingSelectParameters
public int setTrailingSelectParameters(BackendPreparedStatement stmt, int index, int limit, int offset)
Description copied from interface:BackendSets optional parameters after applying the original parameters.- Specified by:
setTrailingSelectParametersin interfaceBackend- Overrides:
setTrailingSelectParametersin classAbstractSql92Backend- Parameters:
stmt- the prepared statementindex- the first parameter indexlimit- the limit value, ≤ 0 if no limit clauseoffset- the offset value, ≤ 0 if no offset clause- Returns:
- the next parameter index
-
supportsSequences
public boolean supportsSequences()
Description copied from interface:BackendTrue if backend provides transactionless sequences.- Specified by:
supportsSequencesin interfaceBackend- Overrides:
supportsSequencesin classAbstractSql92Backend- Returns:
- true if database supports sequences
-
sqlNextFromSequene
public java.lang.String sqlNextFromSequene(java.lang.String name)
Description copied from interface:BackendCreates the SQL string to retrieve the next id from a sequence.- Specified by:
sqlNextFromSequenein interfaceBackend- Overrides:
sqlNextFromSequenein classAbstractSql92Backend- Parameters:
name- the name of the sequence- Returns:
- the SQL code
-
-