Class MySQLDictionary
java.lang.Object
org.apache.openjpa.jdbc.sql.DBDictionary
org.apache.openjpa.jdbc.sql.AbstractMySQLDictionary
org.apache.openjpa.jdbc.sql.MySQLDictionary
- All Implemented Interfaces:
JoinSyntaxes, Configurable, IdentifierConfiguration, ConnectionDecorator, LoggingConnectionDecorator.SQLWarningHandler
Dictionary for MySQL.
-
Nested Class Summary
Nested classes/interfaces inherited from class DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData -
Field Summary
FieldsFields inherited from class AbstractMySQLDictionary
DELIMITER_BACK_TICK, driverDeserializesBlobs, longBlobTypeName, longTextTypeName, mediumBlobTypeName, mediumTextTypeName, optimizeMultiTableDeletes, tableType, tinyBlobTypeName, tinyTextTypeName, useClobsFields inherited from class DBDictionary
_procs, _proxyManager, allowQueryTimeoutOnFindUpdate, allowsAliasInBulkClause, allowsBulkTargetInSubselect, arrayTypeName, autoAssignClause, autoAssignTypeName, backslashEscapesInStringLiterals, batchLimit, bigintTypeName, binaryTypeName, bitLengthFunction, bitTypeName, blobBufferSize, blobTypeName, booleanRepresentation, booleanTypeName, castFunction, catalogSeparator, ceilingFunction, 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, exceptFunction, extractDateTimeFieldFunction, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, fractionalTypeNameSet, fullResultCollectionInOrderByRelation, getStringVal, inClauseLimit, indexPhysicalForeignKeys, initializationSQL, innerJoinClause, integerCastTypeName, integerTypeName, invalidColumnWordSet, invalidTableWordSet, isJDBC3, isJDBC4, javaObjectTypeName, javaToDbColumnNameProcessing, joinSyntax, lastGeneratedKeyQuery, leadingDelimiter, leftFunctionName, log, longCastTypeName, longVarbinaryTypeName, longVarcharTypeName, maxAutoAssignNameLength, maxColumnNameLength, maxConstraintNameLength, maxEmbeddedBlobSize, maxEmbeddedClobSize, maxIndexesPerTable, maxIndexNameLength, maxTableNameLength, MICRO, MILLI, NAME_ANY, NAME_SEQUENCE, NAME_TABLE, nameConcatenator, NANO, nativeSequenceType, naturalLogarithmFunction, nextSequenceQuery, NO_BATCH, nullTypeName, numericTypeName, otherTypeName, outerJoinClause, platform, RANGE_POST_DISTINCT, RANGE_POST_LOCK, RANGE_POST_SELECT, RANGE_PRE_DISTINCT, rangePosition, realTypeName, refTypeName, replaceFunctionName, reportsSuccessNoInfoOnBatchUpdates, requiresAliasForSubselect, requiresAutoCommitForMetaData, requiresCastForCaseStringResult, requiresCastForComparisons, requiresCastForExtractOperand, requiresCastForMathFunctions, requiresConditionForCrossJoin, requiresSearchStringEscapeForLike, requiresTargetForDelete, reservedWords, reservedWordSet, rightFunctionName, roundTimeToMillisec, SCHEMA_CASE_LOWER, SCHEMA_CASE_PRESERVE, SCHEMA_CASE_UPPER, schemaCase, searchStringEscape, searchStringNoEscape, 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, supportsUnsizedCharOnCast, supportsUuidType, supportsXMLColumn, systemSchemas, systemSchemaSet, systemTables, systemTableSet, tableForUpdateClause, tableLengthIncludesSchema, tableTypes, timestampTypeName, timestampWithZoneTypeName, timeTypeName, timeWithZoneTypeName, tinyintTypeName, toLowerCaseFunction, toUpperCaseFunction, trailingDelimiter, trimBothFunction, trimLeadingFunction, trimSchemaName, trimStringColumns, trimTrailingFunction, typecastToStringTypeName, typeModifierSet, UNLIMITED, useGetBestRowIdentifierForPrimaryKeys, useGetBytesForBlobs, useGetObjectForBlobs, useGetStringForClobs, useJDBC4SetBinaryStream, useNativeSequenceCache, useSchemaName, useSetBytesForBlobs, useSetStringForClobs, useWildCardForCount, uuidTypeName, validationSQL, varbinaryTypeName, varcharTypeName, VENDOR_DATADIRECT, VENDOR_OTHER, xmlTypeEncoding, xmlTypeNameFields inherited from interface JoinSyntaxes
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is called when the dictionary first sees any connection.protected booleanMySQL delimits a name that is a reserved word, also under the compatibility optionUpdatedReservedWords=false.intgetBatchFetchSize(int batchFetchSize) protected intThe largest scale of a decimal column the database allows.protected String[]The names of the interfaces a replication connection of the driver implements.protected StringThe name of the fetch configuration hint whose value is appended after theSELECTkeyword of a query.booleanisFatalException(int subtype, SQLException ex) Determine if the given SQL Exception is fatal or recoverable (such as a timeout).booleanWhether the given connection is a Connector/J replication connection, which routes the statements of a read-only connection to a replica: one opened with ajdbc:mysql:replication:URL by Connector/J 8 and later, or by theReplicationDriverof Connector/J 5, also behind the wrapper of a connection pool.protected intmatchErrorState(Map<Integer, Set<String>> errorStates, SQLException ex) Determine the more appropriate type of store exception by matching the SQL Error State of the the given SQLException to the given Error States categorized by error types.Methods inherited from class AbstractMySQLDictionary
addUpdatedReservedTableWords, addUpdatedReservedWords, appendNullsPrecedence, appendSelectRange, appendXmlComparison, configureNamingRules, getAddPrimaryKeySQL, getBlobObject, getCreateTableSQL, getDeleteTableContentsSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getExtractDateTimeFieldFunction, getLocalTime, getPreferredType, getSelectOperation, getSelectTableAliases, getTypeName, indexOf, newColumn, setConfiguration, setLocalTime, toJDBCEscapedDateTimeLiteral, useFractionalSecondTemporalTypes, usesUpdatedReservedWordsMethods inherited from class DBDictionary
addCastAsType, addErrorCode, allowsBulkUpdateOfJoinedTables, appendBulkPrimaryKeysIn, appendCast, appendLength, appendNumericCast, appendSelect, appendSize, appendUpdates, applyRange, assertSupport, calculateValue, canOuterJoin, closeDataSource, combineForeignKey, comment, comparison, convertSchemaCase, convertSchemaCase, copy, copy, createIndexIfNecessary, createIndexIfNecessary, decorate, deleteStream, delimitAll, endConfiguration, executeQuery, fromDBName, getAddColumnSQL, getAddForeignKeySQL, getAlterSequenceSQL, getArray, getAsciiStream, getBatchLimit, getBatchUpdateCount, getBigDecimal, getBigInteger, getBinaryStream, getBlob, getBoolean, getBooleanRepresentation, getByte, getBytes, getCalendar, getCastFunction, getCastFunction, getCatalogNameForMetadata, getCatalogNameForMetadata, getChar, getCharacterStream, getClob, getClobString, getColumnDBName, getColumnIdentifier, getColumnNameForMetadata, getColumnNameForMetadata, getColumns, getColumns, getConversionKey, getCreateIndexSQL, getCreateSequenceSQL, getCreateTableSQL, getDate, getDate, getDateFractionDigits, getDeclareColumnSQL, getDefaultIdentifierRule, getDefaultSchemaName, getDeleteTargets, getDelimitedCase, getDelimitIdentifiers, getDouble, getDropColumnSQL, getDropSequenceSQL, getDropTableSQL, getExtractDateTimePartFunction, getExtractField, getExtractOperandCastType, getFloat, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFromSelect, getFullIdentifier, getFullName, getFullName, getFullName, getGeneratedKey, getGeneratedKeySequenceName, getGenKeySeqName, getIdentifierConcatenator, getIdentifierDelimiter, getIdentifierRule, getIdentifierRules, getIdentityColumnName, getImportedKeys, getImportedKeys, getImportedKeys, getImportedKeys, getIndexInfo, getIndexInfo, getInstant, getInt, getIntegerCastTypeName, getInvalidColumnWordSet, getInvalidTableWordSet, getIsNotNullSQL, getIsNullSQL, getJDBCType, getJDBCType, getJDBCType, getKey, getLeadingDelimiter, getLOBStream, getLocalDate, getLocalDateTime, getLocale, getLog, getLong, getLongCastTypeName, getMajorVersion, getMarkerForInsertUpdate, getMillisecondBehavior, getMinorVersion, getNamingUtil, getNormalizingRule, getNumber, getNumberCastTypeName, getObject, getOffsetDateTime, getOffsetTime, getPlaceholderValueString, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelects, getSequence, getSequenceIncrement, getSequences, getSequences, getSequencesSQL, getSequencesSQL, getShort, getStoreCharsAsNumbers, getStoredProcedure, getStoredProcedureCallSQL, getStoredProcedureNameCandidates, getString, getStringCastTypeName, getSupportsDelimitedIdentifiers, getSupportsXMLColumn, getTableNameForMetadata, getTableNameForMetadata, getTables, getTables, getTime, getTimestamp, getTimestampPrecision, getTrailingDelimiter, getTrimSchemaName, getTypeName, getUniqueConstraintSQL, getValidColumnName, getValidColumnName, getValidColumnName, getValidColumnName, getValidDefaultSequenceName, getValidDefaultTableName, getValidForeignKeyName, getValidForeignKeyName, getValidIndexName, getValidIndexName, getValidPrimaryKeyName, getValidSequenceName, getValidSequenceName, getValidTableName, getValidTableName, getValidUniqueName, getValidUniqueName, getVersionColumn, getVersionColumn, getWhere, getXMLTypeEncoding, getYear, handleWarning, insertBlobForStreamingLoad, insertClobForStreamingLoad, insertSize, isConnected, isDroppable, isImplicitJoin, isSelect, isStoreCharsAsNumbersExplicit, isSystemIndex, isSystemIndex, isSystemSequence, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, isUnsizedDecimal, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, left, makeNameValid, makeNameValid, makeNameValid, makeNameValid, mathFunction, needsToCreateIndex, needsToCreateIndex, newForeignKey, newIndex, newPrimaryKey, newSequence, newStoreException, newTable, normalize, prepareStatement, processDBColumnName, putBytes, putChars, putString, refSchemaComponents, replace, right, serialize, setArray, setAsciiStream, setBatchLimit, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setBooleanRepresentation, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setClobString, setDate, setDate, setDateMillisecondBehavior, setDefaultSchemaName, setDelimitedCase, setDelimitIdentifiers, setDouble, setFloat, setInstant, setInt, setJoinSyntax, setLeadingDelimiter, setLocalDate, setLocalDateTime, setLocale, setLong, setMajorVersion, setMinorVersion, setNull, setNumber, setObject, setOffsetDateTime, setOffsetTime, setQueryTimeout, setRef, setShort, setStatementQueryTimeout, setStoreCharsAsNumbers, setString, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setUnknown, setXMLTypeEncoding, setYear, shorten, startConfiguration, storageWarning, substring, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsIsolationForUpdate, supportsLocking, supportsRandomAccessResultSet, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toNativeJoin, toOperation, toOperation, toSelect, toSelect, toSelect, toSelect, toSelect, toSelectCount, toSnakeCase, toSQL92Join, toStringLiteral, toTableUpdate, toTraditionalJoin, toTypedDateTimeLiteral, toUpdate, updateBlob, updateClob, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
-
Field Details
-
SELECT_HINT
- See Also:
-
-
Constructor Details
-
MySQLDictionary
public MySQLDictionary()
-
-
Method Details
-
getSelectHint
Description copied from class:AbstractMySQLDictionaryThe name of the fetch configuration hint whose value is appended after theSELECTkeyword of a query.- Specified by:
getSelectHintin classAbstractMySQLDictionary- See Also:
-
getMaxDecimalScale
protected int getMaxDecimalScale()Description copied from class:AbstractMySQLDictionaryThe largest scale of a decimal column the database allows.- Specified by:
getMaxDecimalScalein classAbstractMySQLDictionary
-
connectedConfiguration
Description copied from class:DBDictionaryThis 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:
connectedConfigurationin classDBDictionary- Throws:
SQLException
-
isReplicationConnection
Whether the given connection is a Connector/J replication connection, which routes the statements of a read-only connection to a replica: one opened with ajdbc:mysql:replication:URL by Connector/J 8 and later, or by theReplicationDriverof Connector/J 5, also behind the wrapper of a connection pool. The configured driver name is only consulted when the driver's replication connection interfaces cannot be loaded.- Overrides:
isReplicationConnectionin classDBDictionary- Parameters:
conn- a connection of the store, possibly wrapped by OpenJPA's decorators- Throws:
SQLException
-
getReplicationConnectionTypeNames
The names of the interfaces a replication connection of the driver implements. -
delimitsReservedWords
protected boolean delimitsReservedWords()MySQL delimits a name that is a reserved word, also under the compatibility optionUpdatedReservedWords=false.- Specified by:
delimitsReservedWordsin classAbstractMySQLDictionary
-
getBatchFetchSize
public int getBatchFetchSize(int batchFetchSize) - Overrides:
getBatchFetchSizein classDBDictionary
-
matchErrorState
Description copied from class:DBDictionaryDetermine the more appropriate type of store exception by matching the SQL Error State of the the given SQLException to the given Error States categorized by error types. Dictionary subclass can override this method and extract SQLException data to figure out if the exception is recoverable.- Overrides:
matchErrorStatein classDBDictionary- Parameters:
errorStates- classification of SQL error states by their specific nature. The keys of the map represent one of the constants defined inStoreException. The value corresponding to a key represent the set of SQL Error States representing specific category of database error. This supplied map is sourced fromsql-error-state-codes.xml and filtered the error states for the current database.ex- original SQL Exception as raised by the database driver.- Returns:
- A constant indicating the category of error as defined in
StoreException.
-
isFatalException
Description copied from class:DBDictionaryDetermine 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:
isFatalExceptionin 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.
-