Package org.apache.openjpa.jdbc.sql
Class OracleDictionary
java.lang.Object
org.apache.openjpa.jdbc.sql.DBDictionary
org.apache.openjpa.jdbc.sql.OracleDictionary
- All Implemented Interfaces:
JoinSyntaxes
,Configurable
,IdentifierConfiguration
,ConnectionDecorator
,LoggingConnectionDecorator.SQLWarningHandler
Dictionary for Oracle.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData
-
Field Summary
Modifier and TypeFieldDescriptionDeprecated.boolean
Whether this JDBC driver has native java.time support for LocalDate, LocalDateTime, LocalTime, OffsetTime and OffsetDateTimeboolean
Flag to use OpenJPA 0.3 style naming for auto assign sequence name and trigger name for backwards compatibility.static final String
boolean
Deprecated.boolean
If true, then OpenJPA will attempt to use the special OraclePreparedStatement.setFormOfUse method to configure statements that it detects are operating on unicode fields.boolean
Deprecated.static final String
Type constructor for XML column, used in INSERT and UPDATE statements.Fields inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
_procs, _proxyManager, allowQueryTimeoutOnFindUpdate, allowsAliasInBulkClause, arrayTypeName, autoAssignClause, autoAssignTypeName, batchLimit, bigintTypeName, binaryTypeName, bitLengthFunction, bitTypeName, blobBufferSize, blobTypeName, booleanRepresentation, booleanTypeName, castFunction, catalogSeparator, CENTI, characterColumnSize, charTypeName, clobBufferSize, clobTypeName, closePoolSQL, concatenateDelimiter, concatenateFunction, conf, connected, CONS_NAME_AFTER, CONS_NAME_BEFORE, CONS_NAME_MID, constraintNameMode, createPrimaryKeys, crossJoinClause, currentDateFunction, currentTimeFunction, currentTimestampFunction, databaseProductName, databaseProductVersion, dateFractionDigits, datePrecision, dateTypeName, DECI, decimalTypeName, defaultSchemaName, delimitedCase, disableAlterSeqenceIncrementBy, disableSchemaFactoryColumnTypeErrors, distinctCountColumnSeparator, distinctTypeName, doubleTypeName, driverVendor, dropTableSQL, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, fractionalTypeNameSet, fullResultCollectionInOrderByRelation, getStringVal, inClauseLimit, indexPhysicalForeignKeys, initializationSQL, innerJoinClause, integerTypeName, invalidColumnWordSet, isJDBC3, isJDBC4, javaObjectTypeName, javaToDbColumnNameProcessing, joinSyntax, lastGeneratedKeyQuery, leadingDelimiter, log, longVarbinaryTypeName, longVarcharTypeName, maxAutoAssignNameLength, maxColumnNameLength, maxConstraintNameLength, maxEmbeddedBlobSize, maxEmbeddedClobSize, maxIndexesPerTable, maxIndexNameLength, maxTableNameLength, MICRO, MILLI, NAME_ANY, NAME_SEQUENCE, NAME_TABLE, nameConcatenator, NANO, nativeSequenceType, nextSequenceQuery, NO_BATCH, nullTypeName, numericTypeName, otherTypeName, outerJoinClause, platform, RANGE_POST_DISTINCT, RANGE_POST_LOCK, RANGE_POST_SELECT, RANGE_PRE_DISTINCT, rangePosition, realTypeName, refTypeName, reportsSuccessNoInfoOnBatchUpdates, requiresAliasForSubselect, requiresAutoCommitForMetaData, requiresCastForComparisons, requiresCastForMathFunctions, requiresConditionForCrossJoin, requiresSearchStringEscapeForLike, requiresTargetForDelete, reservedWords, reservedWordSet, roundTimeToMillisec, SCHEMA_CASE_LOWER, SCHEMA_CASE_PRESERVE, SCHEMA_CASE_UPPER, schemaCase, searchStringEscape, SEC, selectWords, selectWordSet, sequenceNameSQL, sequenceSchemaSQL, sequenceSQL, setStringRightTruncationOn, simulateLocking, smallintTypeName, sqlStateCodes, storageLimitationsFatal, storeCharsAsNumbers, storeLargeNumbersAsStrings, stringLengthFunction, structTypeName, substringFunctionName, supportsAlterTableWithAddColumn, supportsAlterTableWithDropColumn, supportsAutoAssign, supportsCascadeDeleteAction, supportsCascadeUpdateAction, supportsCaseConversionForLob, supportsComments, supportsCorrelatedSubselect, supportsDefaultDeleteAction, supportsDefaultUpdateAction, supportsDeferredConstraints, supportsDelimitedIdentifiers, supportsForeignKeys, supportsForeignKeysComposite, supportsGeneralCaseExpression, supportsGetGeneratedKeys, supportsHaving, supportsLockingWithDistinctClause, supportsLockingWithInnerJoin, supportsLockingWithMultipleTables, supportsLockingWithOrderClause, supportsLockingWithOuterJoin, supportsLockingWithSelectRange, supportsModOperator, supportsMultipleNontransactionalResultSets, supportsNullDeleteAction, supportsNullTableForGetColumns, supportsNullTableForGetImportedKeys, supportsNullTableForGetIndexInfo, supportsNullTableForGetPrimaryKeys, supportsNullUniqueColumn, supportsNullUpdateAction, supportsParameterInSelect, supportsQueryTimeout, supportsRestrictDeleteAction, supportsRestrictUpdateAction, supportsSchemaForGetColumns, supportsSchemaForGetTables, supportsSelectEndIndex, supportsSelectForUpdate, supportsSelectFromFinalTable, supportsSelectStartIndex, supportsSimpleCaseExpression, supportsSubselect, supportsUniqueConstraints, supportsXMLColumn, systemSchemas, systemSchemaSet, systemTables, systemTableSet, tableForUpdateClause, tableLengthIncludesSchema, tableTypes, timestampTypeName, timestampWithZoneTypeName, timeTypeName, timeWithZoneTypeName, tinyintTypeName, toLowerCaseFunction, toUpperCaseFunction, trailingDelimiter, trimBothFunction, trimLeadingFunction, trimSchemaName, trimStringColumns, trimTrailingFunction, typeModifierSet, UNLIMITED, useGetBestRowIdentifierForPrimaryKeys, useGetBytesForBlobs, useGetObjectForBlobs, useGetStringForClobs, useJDBC4SetBinaryStream, useNativeSequenceCache, useSchemaName, useSetBytesForBlobs, useSetStringForClobs, useWildCardForCount, validationSQL, varbinaryTypeName, varcharTypeName, VENDOR_DATADIRECT, VENDOR_OTHER, xmlTypeEncoding, xmlTypeName
Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendXmlComparison
(SQLBuffer buf, String op, FilterValue lhs, FilterValue rhs, boolean lhsxml, boolean rhsxml) If this dictionary supports XML type, use this method to append xml predicate.boolean
canOuterJoin
(int syntax, ForeignKey fk) Returns if the given foreign key can be eagerly loaded using other joins.void
This method is called when the dictionary first sees any connection.void
Invoked upon completion of bean property configuration for this object.void
Ensure that the driver vendor has been set, and if not, set it now.int
Return batched statements update success countgetClobString
(ResultSet rs, int column) Convert the specified column of the SQL ResultSet to the proper java type.Column[]
getColumns
(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) Reflect on the schema to find columns matching the given table and column patterns.Column[]
getColumns
(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, DBIdentifier columnName, Connection conn) Reflect on the schema to find columns matching the given table and column patterns.String[]
getCreateTableSQL
(Table table) Return a series of SQL statements to create the given table, complete with columns.protected String
getDeclareColumnSQL
(Column col, boolean alter) Return the declaration SQL for the given column.getGeneratedKey
(Column col, Connection conn) Return the last generated value for the given column.protected String
Trigger name for simulating auto-assign values on the given column.getImportedKeys
(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn, boolean partialKeys) Reflect on the schema to return full foreign keys imported by the given table pattern.getImportedKeys
(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn, boolean partialKeys) Reflect on the schema to return full foreign keys imported by the given table pattern.Index[]
getIndexInfo
(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique, boolean approx, Connection conn) Reflect on the schema to find indexes matching the given table pattern.Index[]
getIndexInfo
(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, boolean unique, boolean approx, Connection conn) Reflect on the schema to find indexes matching the given table pattern.getIsNotNullSQL
(String colAlias, int colType) getIsNullSQL
(String colAlias, int colType) int
getJDBCType
(int metaTypeCode, boolean lob, int precis, int scale, boolean xml) getLocalDate
(ResultSet rs, int column) Retrieve the specified column of the SQL ResultSet to the properLocalDate
java type.getLocalDateTime
(ResultSet rs, int column) Retrieve the specified column of the SQL ResultSet to the properLocalDateTime
java type.getLocalTime
(ResultSet rs, int column) Retrieve the specified column of the SQL ResultSet to the properLocalTime
java type.getMarkerForInsertUpdate
(Column col, Object val) Oracle requires special handling of XML column.Convert the specified column of the SQL ResultSet to the proper java type.getOffsetDateTime
(ResultSet rs, int column) Retrieve the specified column of the SQL ResultSet to the properOffsetDateTime
java type.protected String
Returns a OpenJPA 3-compatible name for an auto-assign sequence.protected String
Returns a OpenJPA 3-compatible name for an auto-assign trigger.int
getPreferredType
(int type) Oracle JDBC is still Java7 at most :(getPrimaryKeys
(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) Reflect on the schema to find primary keys for the given table pattern.getPrimaryKeys
(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn) Reflect on the schema to find primary keys for the given table pattern.Check to see if we have set theSELECT_HINT
in the fetch configuration, and if so, append the Oracle hint after the "SELECT" part of the query.protected SQLBuffer
getSelects
(Select sel, boolean distinctIdentifiers, boolean forUpdate) Return the portion of the select statement between the SELECT keyword and the FROM keyword.protected String
getSequencesSQL
(String schemaName, String sequenceName) Return the SQL needed to select the list of sequences.protected String
getSequencesSQL
(DBIdentifier schemaName, DBIdentifier sequenceName) getTimestamp
(ResultSet rs, int column, Calendar cal) Convert the specified column of the SQL ResultSet to the proper java type.protected void
guessJDBCVersion
(Connection conn) Oracle drivers, at least in versions 10.2.0.4 and 11.2.0.1, incorrectly return a driver major version fromDatabaseMetaData.getJDBCMajorVersion()
.void
indexOf
(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start) Invoke this database's indexOf function.void
void
insertClobForStreamingLoad
(Row row, Column col, Object ob) boolean
isFatalException
(int subtype, SQLException ex) Determine if the given SQL Exception is fatal or recoverable (such as a timeout).boolean
boolean
isSystemSequence
(String name, String schema, boolean targetSchema) This method is used to filter system sequences from database metadata.boolean
isSystemSequence
(DBIdentifier name, DBIdentifier schema, boolean targetSchema) This method is used to filter system sequences from database metadata.void
Invoke Oracle'sputBytes
method on the given BLOB object.void
Invoke Oracle'sputChars
method on the given CLOB object.void
Invoke Oracle'sputString
method on the given CLOB object.void
setBinaryStream
(PreparedStatement stmnt, int idx, InputStream val, int length, Column col) Set the given value as a parameter to the statement.void
setClobString
(PreparedStatement stmnt, int idx, String val, Column col) Set the given value as a parameter to the statement.void
setLocalDate
(PreparedStatement stmnt, int idx, LocalDate val, Column col) Set the given LocalDate value as a parameter to the statement.void
setLocalDateTime
(PreparedStatement stmnt, int idx, LocalDateTime val, Column col) Set the given LocalTime value as a parameter to the statement.void
setLocalTime
(PreparedStatement stmnt, int idx, LocalTime val, Column col) Set the given LocalTime value as a parameter to the statement.void
setNull
(PreparedStatement stmnt, int idx, int colType, Column col) Set null as a parameter to the statement.void
setOffsetDateTime
(PreparedStatement stmnt, int idx, OffsetDateTime val, Column col) Set the given LocalTime value as a parameter to the statement.void
setString
(PreparedStatement stmnt, int idx, String val, Column col) Set the given value as a parameter to the statement.boolean
supportsLocking
(Select sel) Returns true if a "FOR UPDATE" clause can be used for the specified Select object.toNativeJoin
(Join join) Use the given join instance to create SQL joining its tables in the database's native syntax.protected SQLBuffer
toSelect
(SQLBuffer select, JDBCFetchConfiguration fetch, SQLBuffer tables, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end, boolean subselect, Select sel) Combine the given components into a SELECT statement.protected SQLBuffer
toSelect
(SQLBuffer select, JDBCFetchConfiguration fetch, SQLBuffer tables, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end, Select sel) Combine the given components into a SELECT statement.Methods inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
addCastAsType, addErrorCode, appendCast, appendLength, appendNumericCast, appendSelect, appendSelectRange, appendSize, appendUpdates, applyRange, assertSupport, calculateValue, closeDataSource, combineForeignKey, comment, comparison, configureNamingRules, convertSchemaCase, convertSchemaCase, copy, copy, createIndexIfNecessary, createIndexIfNecessary, decorate, deleteStream, delimitAll, executeQuery, fromDBName, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getAlterSequenceSQL, getArray, getAsciiStream, getBatchFetchSize, getBatchLimit, getBigDecimal, getBigInteger, getBinaryStream, getBlob, getBlobObject, getBoolean, getBooleanRepresentation, getByte, getBytes, getCalendar, getCastFunction, getCastFunction, getCatalogNameForMetadata, getCatalogNameForMetadata, getChar, getCharacterStream, getClob, getColumnDBName, getColumnIdentifier, getColumnNameForMetadata, getColumnNameForMetadata, getConversionKey, getCreateIndexSQL, getCreateSequenceSQL, getCreateTableSQL, getDate, getDate, getDateFractionDigits, getDefaultIdentifierRule, getDefaultSchemaName, getDeleteTableContentsSQL, getDeleteTargets, getDelimitedCase, getDelimitIdentifiers, getDouble, getDropColumnSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropSequenceSQL, getDropTableSQL, getFloat, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFromSelect, getFullIdentifier, getFullName, getFullName, getFullName, getGeneratedKeySequenceName, getGenKeySeqName, getIdentifierConcatenator, getIdentifierDelimiter, getIdentifierRule, getIdentifierRules, getIdentityColumnName, getImportedKeys, getImportedKeys, getInt, getInvalidColumnWordSet, getJDBCType, getJDBCType, getKey, getLeadingDelimiter, getLOBStream, getLocale, getLog, getLong, getMajorVersion, getMillisecondBehavior, getMinorVersion, getNamingUtil, getNumber, getOffsetTime, getPlaceholderValueString, getPrimaryKeyConstraintSQL, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelectTableAliases, getSequence, getSequences, getSequences, getShort, getStoredProcedure, getString, getSupportsDelimitedIdentifiers, getSupportsXMLColumn, getTableNameForMetadata, getTableNameForMetadata, getTables, getTables, getTime, getTrailingDelimiter, getTrimSchemaName, getTypeName, getTypeName, getUniqueConstraintSQL, getValidColumnName, getValidColumnName, getValidColumnName, getValidColumnName, getValidForeignKeyName, getValidForeignKeyName, getValidIndexName, getValidIndexName, getValidPrimaryKeyName, getValidSequenceName, getValidSequenceName, getValidTableName, getValidTableName, getValidUniqueName, getValidUniqueName, getVersionColumn, getVersionColumn, getWhere, getXMLTypeEncoding, handleWarning, insertSize, isSelect, isSystemIndex, isSystemIndex, isSystemSequence, isSystemTable, isSystemTable, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, makeNameValid, makeNameValid, makeNameValid, makeNameValid, matchErrorState, mathFunction, needsToCreateIndex, needsToCreateIndex, newColumn, newForeignKey, newIndex, newPrimaryKey, newSequence, newStoreException, newTable, prepareStatement, processDBColumnName, refSchemaComponents, serialize, setArray, setAsciiStream, setBatchLimit, setBigDecimal, setBigInteger, setBlob, setBlobObject, setBoolean, setBooleanRepresentation, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setConfiguration, setDate, setDate, setDateMillisecondBehavior, setDefaultSchemaName, setDelimitedCase, setDelimitIdentifiers, setDouble, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocale, setLong, setMajorVersion, setMinorVersion, setNumber, setObject, setOffsetTime, setQueryTimeout, setRef, setShort, setStatementQueryTimeout, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setUnknown, setXMLTypeEncoding, shorten, startConfiguration, storageWarning, substring, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsIsolationForUpdate, supportsRandomAccessResultSet, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toOperation, toOperation, toSelect, toSelect, toSelect, toSelectCount, toSnakeCase, toSQL92Join, toTraditionalJoin, toUpdate, updateBlob, updateClob, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
-
Field Details
-
SELECT_HINT
- See Also:
-
VENDOR_ORACLE
- See Also:
-
useTriggersForAutoAssign
Deprecated.If true, then simulate auto-assigned values in Oracle by using a trigger that inserts a sequence value into the primary key value when a row is inserted. -
autoAssignSequenceName
Deprecated.The global sequence name to use for autoassign simulation. -
nativeJavaTimeSupport
public boolean nativeJavaTimeSupportWhether this JDBC driver has native java.time support for LocalDate, LocalDateTime, LocalTime, OffsetTime and OffsetDateTime -
openjpa3GeneratedKeyNames
public boolean openjpa3GeneratedKeyNamesFlag to use OpenJPA 0.3 style naming for auto assign sequence name and trigger name for backwards compatibility. -
useSetFormOfUseForUnicode
public boolean useSetFormOfUseForUnicodeIf true, then OpenJPA will attempt to use the special OraclePreparedStatement.setFormOfUse method to configure statements that it detects are operating on unicode fields. -
supportsSetClob
Deprecated.This variable was used prior to 2.1.x to indicate that OpenJPA should attempt to use a Reader-based JDBC 4.0 method to set Clob or XML data. It allowed XMLType and Clob values larger than 4000 bytes to be used. For 2.1.x+, code was added to allow said functionality by default (see OPENJPA-1691). For forward compatibility, this variable should not be removed. -
xmlTypeMarker
Type constructor for XML column, used in INSERT and UPDATE statements.
-
-
Constructor Details
-
OracleDictionary
public OracleDictionary()
-
-
Method Details
-
endConfiguration
public void endConfiguration()Description copied from interface:Configurable
Invoked upon completion of bean property configuration for this object.- Specified by:
endConfiguration
in interfaceConfigurable
- Overrides:
endConfiguration
in classDBDictionary
-
connectedConfiguration
Description copied from class:DBDictionary
This method is called when the dictionary first sees any connection. It is used to initialize dictionary metadata if needed. If you override this method, be sure to callsuper.connectedConfiguration
.- Overrides:
connectedConfiguration
in classDBDictionary
- Throws:
SQLException
-
ensureDriverVendor
public void ensureDriverVendor()Ensure that the driver vendor has been set, and if not, set it now. -
supportsLocking
Description copied from class:DBDictionary
Returns true if a "FOR UPDATE" clause can be used for the specified Select object.- Overrides:
supportsLocking
in classDBDictionary
-
getDeclareColumnSQL
Return the declaration SQL for the given column. This method is used for each column from withingetCreateTableSQL(org.apache.openjpa.jdbc.schema.Table)
andDBDictionary.getAddColumnSQL(org.apache.openjpa.jdbc.schema.Column)
. Oracle needs a bit special handling for auto assign columns. For those ("GENERATED ALWAYS AS IDENTITY") we must not generate NOT NULL as this would create invalid statements for Oracle.- Overrides:
getDeclareColumnSQL
in classDBDictionary
-
getSelects
Description copied from class:DBDictionary
Return the portion of the select statement between the SELECT keyword and the FROM keyword.- Overrides:
getSelects
in classDBDictionary
-
canOuterJoin
Description copied from class:DBDictionary
Returns if the given foreign key can be eagerly loaded using other joins.- Overrides:
canOuterJoin
in classDBDictionary
-
toNativeJoin
Description copied from class:DBDictionary
Use the given join instance to create SQL joining its tables in the database's native syntax. Throws an exception by default.- Overrides:
toNativeJoin
in classDBDictionary
-
toSelect
protected SQLBuffer toSelect(SQLBuffer select, JDBCFetchConfiguration fetch, SQLBuffer tables, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end, boolean subselect, Select sel) Description copied from class:DBDictionary
Combine the given components into a SELECT statement.- Overrides:
toSelect
in classDBDictionary
-
toSelect
protected SQLBuffer toSelect(SQLBuffer select, JDBCFetchConfiguration fetch, SQLBuffer tables, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end, Select sel) Description copied from class:DBDictionary
Combine the given components into a SELECT statement.- Overrides:
toSelect
in classDBDictionary
-
getSelectOperation
Check to see if we have set theSELECT_HINT
in the fetch configuration, and if so, append the Oracle hint after the "SELECT" part of the query.- Overrides:
getSelectOperation
in classDBDictionary
-
setString
Description copied from class:DBDictionary
Set the given value as a parameter to the statement.- Overrides:
setString
in classDBDictionary
- Throws:
SQLException
-
setBinaryStream
public void setBinaryStream(PreparedStatement stmnt, int idx, InputStream val, int length, Column col) throws SQLException Description copied from class:DBDictionary
Set the given value as a parameter to the statement.- Overrides:
setBinaryStream
in classDBDictionary
- Throws:
SQLException
-
setClobString
public void setClobString(PreparedStatement stmnt, int idx, String val, Column col) throws SQLException Description copied from class:DBDictionary
Set the given value as a parameter to the statement.- Overrides:
setClobString
in classDBDictionary
- Throws:
SQLException
-
setNull
Description copied from class:DBDictionary
Set null as a parameter to the statement. The column type will come fromTypes
.- Overrides:
setNull
in classDBDictionary
- Throws:
SQLException
-
setLocalDate
public void setLocalDate(PreparedStatement stmnt, int idx, LocalDate val, Column col) throws SQLException Description copied from class:DBDictionary
Set the given LocalDate value as a parameter to the statement.- Overrides:
setLocalDate
in classDBDictionary
- Throws:
SQLException
-
getLocalDate
Description copied from class:DBDictionary
Retrieve the specified column of the SQL ResultSet to the properLocalDate
java type.- Overrides:
getLocalDate
in classDBDictionary
- Throws:
SQLException
-
setLocalTime
public void setLocalTime(PreparedStatement stmnt, int idx, LocalTime val, Column col) throws SQLException Description copied from class:DBDictionary
Set the given LocalTime value as a parameter to the statement.- Overrides:
setLocalTime
in classDBDictionary
- Throws:
SQLException
-
getLocalTime
Description copied from class:DBDictionary
Retrieve the specified column of the SQL ResultSet to the properLocalTime
java type.- Overrides:
getLocalTime
in classDBDictionary
- Throws:
SQLException
-
setLocalDateTime
public void setLocalDateTime(PreparedStatement stmnt, int idx, LocalDateTime val, Column col) throws SQLException Description copied from class:DBDictionary
Set the given LocalTime value as a parameter to the statement.- Overrides:
setLocalDateTime
in classDBDictionary
- Throws:
SQLException
-
getLocalDateTime
Description copied from class:DBDictionary
Retrieve the specified column of the SQL ResultSet to the properLocalDateTime
java type.- Overrides:
getLocalDateTime
in classDBDictionary
- Throws:
SQLException
-
setOffsetDateTime
public void setOffsetDateTime(PreparedStatement stmnt, int idx, OffsetDateTime val, Column col) throws SQLException Description copied from class:DBDictionary
Set the given LocalTime value as a parameter to the statement.- Overrides:
setOffsetDateTime
in classDBDictionary
- Throws:
SQLException
-
getOffsetDateTime
Description copied from class:DBDictionary
Retrieve the specified column of the SQL ResultSet to the properOffsetDateTime
java type.- Overrides:
getOffsetDateTime
in classDBDictionary
- Throws:
SQLException
-
getClobString
Description copied from class:DBDictionary
Convert the specified column of the SQL ResultSet to the proper java type.- Overrides:
getClobString
in classDBDictionary
- Throws:
SQLException
-
getTimestamp
Description copied from class:DBDictionary
Convert the specified column of the SQL ResultSet to the proper java type.- Overrides:
getTimestamp
in classDBDictionary
- Throws:
SQLException
-
getObject
Description copied from class:DBDictionary
Convert the specified column of the SQL ResultSet to the proper java type.- Overrides:
getObject
in classDBDictionary
- Throws:
SQLException
-
getColumns
public Column[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to find columns matching the given table and column patterns.- Overrides:
getColumns
in classDBDictionary
- Throws:
SQLException
-
getColumns
public Column[] getColumns(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, DBIdentifier columnName, Connection conn) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to find columns matching the given table and column patterns.- Overrides:
getColumns
in classDBDictionary
- Throws:
SQLException
-
getPreferredType
public int getPreferredType(int type) Oracle JDBC is still Java7 at most :(- Overrides:
getPreferredType
in classDBDictionary
-
getPrimaryKeys
public PrimaryKey[] getPrimaryKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to find primary keys for the given table pattern.- Overrides:
getPrimaryKeys
in classDBDictionary
- Throws:
SQLException
-
getPrimaryKeys
public PrimaryKey[] getPrimaryKeys(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to find primary keys for the given table pattern.- Overrides:
getPrimaryKeys
in classDBDictionary
- Throws:
SQLException
-
getIndexInfo
public Index[] getIndexInfo(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique, boolean approx, Connection conn) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to find indexes matching the given table pattern.- Overrides:
getIndexInfo
in classDBDictionary
- Throws:
SQLException
-
getIndexInfo
public Index[] getIndexInfo(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, boolean unique, boolean approx, Connection conn) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to find indexes matching the given table pattern.- Overrides:
getIndexInfo
in classDBDictionary
- Throws:
SQLException
-
getImportedKeys
public ForeignKey[] getImportedKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn, boolean partialKeys) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to return full foreign keys imported by the given table pattern.- Overrides:
getImportedKeys
in classDBDictionary
- Throws:
SQLException
-
getImportedKeys
public ForeignKey[] getImportedKeys(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn, boolean partialKeys) throws SQLException Description copied from class:DBDictionary
Reflect on the schema to return full foreign keys imported by the given table pattern.- Overrides:
getImportedKeys
in classDBDictionary
- Throws:
SQLException
-
getCreateTableSQL
Description copied from class:DBDictionary
Return a series of SQL statements to create the given table, complete with columns. Indexes and constraints will be created separately.- Overrides:
getCreateTableSQL
in classDBDictionary
-
getJDBCType
public int getJDBCType(int metaTypeCode, boolean lob, int precis, int scale, boolean xml) - Overrides:
getJDBCType
in classDBDictionary
-
getSequencesSQL
Description copied from class:DBDictionary
Return the SQL needed to select the list of sequences.- Overrides:
getSequencesSQL
in classDBDictionary
-
getSequencesSQL
- Overrides:
getSequencesSQL
in classDBDictionary
-
isSystemSequence
Description copied from class:DBDictionary
This method is used to filter system sequences from database metadata. Return true if the given sequence represents a system sequence that should not appear in the schema definition. Returns true if system schema by default.- Overrides:
isSystemSequence
in classDBDictionary
- Parameters:
name
- the table nameschema
- the table schema; may be nulltargetSchema
- if true, then the given schema was listed by the user as one of his schemas
-
isSystemSequence
Description copied from class:DBDictionary
This method is used to filter system sequences from database metadata. Return true if the given sequence represents a system sequence that should not appear in the schema definition. Returns true if system schema by default.- Overrides:
isSystemSequence
in classDBDictionary
- Parameters:
name
- the table nameschema
- the table schema; may be nulltargetSchema
- if true, then the given schema was listed by the user as one of his schemas
-
getGeneratedKey
Description copied from class:DBDictionary
Return the last generated value for the given column. Throws an exception by default ifDBDictionary.lastGeneratedKeyQuery
is null.- Overrides:
getGeneratedKey
in classDBDictionary
- Throws:
SQLException
-
getGeneratedKeyTriggerName
Trigger name for simulating auto-assign values on the given column. -
getOpenJPA3GeneratedKeySequenceName
Returns a OpenJPA 3-compatible name for an auto-assign sequence. -
getOpenJPA3GeneratedKeyTriggerName
Returns a OpenJPA 3-compatible name for an auto-assign trigger. -
putBytes
Invoke Oracle'sputBytes
method on the given BLOB object. Uses reflection in case the blob is wrapped in another vendor-specific class; for example Weblogic wraps oracle thin driver lobs in its own interfaces with the same methods.- Overrides:
putBytes
in classDBDictionary
- Throws:
SQLException
-
putString
Invoke Oracle'sputString
method on the given CLOB object. Uses reflection in case the clob is wrapped in another vendor-specific class; for example Weblogic wraps oracle thin driver lobs in its own interfaces with the same methods.- Overrides:
putString
in classDBDictionary
- Throws:
SQLException
-
putChars
Invoke Oracle'sputChars
method on the given CLOB object. Uses reflection in case the clob is wrapped in another vendor-specific class; for example Weblogic wraps oracle thin driver lobs in its own interfaces with the same methods.- Overrides:
putChars
in classDBDictionary
- Throws:
SQLException
-
appendXmlComparison
public void appendXmlComparison(SQLBuffer buf, String op, FilterValue lhs, FilterValue rhs, boolean lhsxml, boolean rhsxml) If this dictionary supports XML type, use this method to append xml predicate.- Overrides:
appendXmlComparison
in classDBDictionary
- Parameters:
buf
- the SQL buffer to write the comparisonop
- the comparison operation to performlhs
- the left hand side of the comparisonrhs
- the right hand side of the comparison
-
insertClobForStreamingLoad
- Overrides:
insertClobForStreamingLoad
in classDBDictionary
- Throws:
SQLException
-
getBatchUpdateCount
Description copied from class:DBDictionary
Return batched statements update success count- Overrides:
getBatchUpdateCount
in classDBDictionary
- Parameters:
ps
- A PreparedStatement- Returns:
- return update count
- Throws:
SQLException
-
isFatalException
Description copied from class:DBDictionary
Determine if the given SQL Exception is fatal or recoverable (such as a timeout). This implementation always returns true (i.e. all exceptions are fatal). The current dictionary implementation can overwrite this method to mark certain exception conditions as recoverable error.- Overrides:
isFatalException
in classDBDictionary
- Parameters:
subtype
- A constant indicating the category of error as defined inStoreException
.ex
- original SQL Exception as raised by the database driver.- Returns:
- false if the error is fatal.
-
insertBlobForStreamingLoad
public void insertBlobForStreamingLoad(Row row, Column col, JDBCStore store, Object ob, Select sel) throws SQLException - Overrides:
insertBlobForStreamingLoad
in classDBDictionary
- Throws:
SQLException
-
isImplicitJoin
public boolean isImplicitJoin()- Overrides:
isImplicitJoin
in classDBDictionary
-
getMarkerForInsertUpdate
Oracle requires special handling of XML column. Unless the value length is less or equal to 4000 bytes, the parameter marker must be decorated with type constructor.- Overrides:
getMarkerForInsertUpdate
in classDBDictionary
- Parameters:
col
- column definitionval
- value to be inserted/updated- Returns:
- parameter marker
-
guessJDBCVersion
Oracle drivers, at least in versions 10.2.0.4 and 11.2.0.1, incorrectly return a driver major version fromDatabaseMetaData.getJDBCMajorVersion()
. -
getIsNullSQL
- Overrides:
getIsNullSQL
in classDBDictionary
-
getIsNotNullSQL
- Overrides:
getIsNotNullSQL
in classDBDictionary
-
indexOf
Description copied from class:DBDictionary
Invoke this database's indexOf function.- Overrides:
indexOf
in classDBDictionary
- Parameters:
buf
- the SQL buffer to write the indexOf invocation tostr
- a query value representing the target stringfind
- a query value representing the search stringstart
- a query value representing the start index, or null to start at the beginning
-