public class MariaDBDictionary extends DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData
Modifier and Type | Field and Description |
---|---|
static String |
DELIMITER_BACK_TICK |
boolean |
driverDeserializesBlobs
Whether the driver automatically deserializes blobs.
|
static String |
longBlobTypeName |
static String |
mediumBlobTypeName |
boolean |
optimizeMultiTableDeletes
Whether to inline multi-table bulk-delete operations into MySQL's
combined
DELETE FROM foo, bar, baz syntax. |
static String |
SELECT_HINT |
String |
tableType
The MySQL table type to use when creating tables; defaults to innodb.
|
static String |
tinyBlobTypeName |
boolean |
useClobs
Whether to use clobs; defaults to true.
|
_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, datePrecision, dateTypeName, DECI, decimalTypeName, defaultSchemaName, delimitedCase, disableAlterSeqenceIncrementBy, disableSchemaFactoryColumnTypeErrors, distinctCountColumnSeparator, distinctTypeName, doubleTypeName, driverVendor, dropTableSQL, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, fullResultCollectionInOrderByRelation, getStringVal, inClauseLimit, initializationSQL, innerJoinClause, integerTypeName, invalidColumnWordSet, isJDBC3, isJDBC4, javaObjectTypeName, 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, timeTypeName, 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
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL
Constructor and Description |
---|
MariaDBDictionary() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendSelectRange(SQLBuffer buf,
long start,
long end,
boolean subselect)
If this dictionary can select ranges,
use this method to append the range SQL.
|
void |
appendXmlComparison(SQLBuffer buf,
String op,
FilterValue lhs,
FilterValue rhs,
boolean lhsxml,
boolean rhsxml)
Append XML comparison.
|
void |
connectedConfiguration(Connection conn)
This method is called when the dictionary first sees any connection.
|
Connection |
decorate(Connection conn)
Decorate the given connection if needed.
|
String[] |
getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to
its table.
|
int |
getBatchFetchSize(int batchFetchSize) |
Object |
getBlobObject(ResultSet rs,
int column,
JDBCStore store)
Convert the specified column of the SQL ResultSet to the proper
java type.
|
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete
with columns.
|
String[] |
getDeleteTableContentsSQL(Table[] tables,
Connection conn)
Create SQL to delete the contents of the specified tables.
|
String[] |
getDropForeignKeySQL(ForeignKey fk,
Connection conn)
Return
ALTER TABLE <table name> DROP FOREIGN KEY
<fk name> . |
String[] |
getDropIndexSQL(Index index)
Return a series of SQL statements to drop the given index.
|
String[] |
getDropPrimaryKeySQL(PrimaryKey pk)
Return
ALTER TABLE <table name> DROP PRIMARY KEY . |
int |
getPreferredType(int type)
Return the preferred
Types type for the given one. |
String |
getSelectOperation(JDBCFetchConfiguration fetch)
Check to see if we have set the
SELECT_HINT in the
fetch configuration, and if so, append the MySQL hint after the
"SELECT" part of the query. |
protected Collection<String> |
getSelectTableAliases(Select sel) |
String |
getTypeName(Column col)
OPENJPA-740 Special case for MySql special column types,
like LONGTEXT, LONGBLOG etc..
|
void |
indexOf(SQLBuffer buf,
FilterValue str,
FilterValue find,
FilterValue start)
Invoke this database's indexOf function.
|
boolean |
isFatalException(int subtype,
SQLException ex)
Determine if the given SQL Exception is fatal or recoverable (such as a timeout).
|
protected int |
matchErrorState(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.
|
protected Column |
newColumn(ResultSet colMeta)
Create a new column from the information in the schema metadata.
|
protected void |
setDelimitedCase(DatabaseMetaData metaData) |
addCastAsType, addErrorCode, appendCast, appendLength, appendNumericCast, appendSelect, appendSize, appendUpdates, applyRange, assertSupport, calculateValue, canOuterJoin, closeDataSource, combineForeignKey, comment, comparison, configureNamingRules, convertSchemaCase, convertSchemaCase, copy, copy, createIndexIfNecessary, createIndexIfNecessary, 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, getDeclareColumnSQL, getDefaultIdentifierRule, getDefaultSchemaName, getDeleteTargets, getDelimitedCase, getDelimitIdentifiers, getDouble, getDropColumnSQL, getDropSequenceSQL, getDropTableSQL, getFloat, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFromSelect, getFullIdentifier, getFullName, getFullName, getFullName, getGeneratedKey, getGeneratedKeySequenceName, getGenKeySeqName, getIdentifierConcatenator, getIdentifierDelimiter, getIdentifierRule, getIdentifierRules, getIdentityColumnName, getImportedKeys, getImportedKeys, getImportedKeys, getImportedKeys, getIndexInfo, getIndexInfo, getInt, getInvalidColumnWordSet, getIsNotNullSQL, getIsNullSQL, getJDBCType, getJDBCType, getJDBCType, getKey, getLeadingDelimiter, getLOBStream, getLocale, getLog, getLong, getMajorVersion, getMarkerForInsertUpdate, getMillisecondBehavior, getMinorVersion, getNamingUtil, getNumber, getObject, getPlaceholderValueString, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelects, getSequence, getSequences, getSequences, getSequencesSQL, getSequencesSQL, getShort, getString, getSupportsDelimitedIdentifiers, getSupportsXMLColumn, getTableNameForMetadata, getTableNameForMetadata, getTables, getTables, getTime, getTimestamp, getTrailingDelimiter, getTrimSchemaName, getTypeName, getUniqueConstraintSQL, getValidColumnName, getValidColumnName, getValidColumnName, getValidColumnName, getValidForeignKeyName, getValidForeignKeyName, getValidIndexName, getValidIndexName, getValidPrimaryKeyName, getValidSequenceName, getValidSequenceName, getValidTableName, getValidTableName, getValidUniqueName, getValidUniqueName, getVersionColumn, getVersionColumn, getWhere, getXMLTypeEncoding, handleWarning, insertBlobForStreamingLoad, insertClobForStreamingLoad, insertSize, isImplicitJoin, isSelect, isSystemIndex, isSystemIndex, isSystemSequence, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, makeNameValid, makeNameValid, makeNameValid, makeNameValid, mathFunction, needsToCreateIndex, needsToCreateIndex, newForeignKey, newIndex, newPrimaryKey, newSequence, newStoreException, newTable, prepareStatement, putBytes, putChars, putString, refSchemaComponents, serialize, setArray, setAsciiStream, setBatchLimit, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setBooleanRepresentation, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setClobString, setConfiguration, setDate, setDate, setDateMillisecondBehavior, setDefaultSchemaName, setDelimitIdentifiers, setDouble, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocale, setLong, setMajorVersion, setMinorVersion, setNull, setNumber, setObject, setQueryTimeout, setRef, setShort, setStatementQueryTimeout, setString, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setUnknown, setXMLTypeEncoding, shorten, startConfiguration, storageWarning, substring, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsIsolationForUpdate, supportsLocking, supportsRandomAccessResultSet, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toNativeJoin, toOperation, toOperation, toSelect, toSelect, toSelect, toSelect, toSelect, toSelectCount, toSQL92Join, toTraditionalJoin, toUpdate, updateBlob, updateClob, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
public static final String SELECT_HINT
public static final String DELIMITER_BACK_TICK
public String tableType
public boolean useClobs
public boolean driverDeserializesBlobs
public boolean optimizeMultiTableDeletes
DELETE FROM foo, bar, baz
syntax.
Defaults to false, since this may fail in the presence of InnoDB tables
with foreign keys.http://dev.mysql.com/doc/refman/5.0/en/delete.html
public static final String tinyBlobTypeName
public static final String mediumBlobTypeName
public static final String longBlobTypeName
public void connectedConfiguration(Connection conn) throws SQLException
DBDictionary
super.connectedConfiguration
.connectedConfiguration
in class DBDictionary
SQLException
protected void setDelimitedCase(DatabaseMetaData metaData)
setDelimitedCase
in class DBDictionary
public Connection decorate(Connection conn) throws SQLException
DBDictionary
DBDictionary.initializationSQL
that has been set for the dictionary but
does not decorate the connection.decorate
in interface ConnectionDecorator
decorate
in class DBDictionary
SQLException
public String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL
in class DBDictionary
public String[] getDropIndexSQL(Index index)
DBDictionary
DROP INDEX <index name>
by default.getDropIndexSQL
in class DBDictionary
public String[] getDropPrimaryKeySQL(PrimaryKey pk)
ALTER TABLE <table name> DROP PRIMARY KEY
.getDropPrimaryKeySQL
in class DBDictionary
public String[] getDropForeignKeySQL(ForeignKey fk, Connection conn)
ALTER TABLE <table name> DROP FOREIGN KEY
<fk name>
.getDropForeignKeySQL
in class DBDictionary
public String[] getAddPrimaryKeySQL(PrimaryKey pk)
DBDictionary
ALTER TABLE <table name> ADD
<pk cons sql >
by default.getAddPrimaryKeySQL
in class DBDictionary
public String[] getDeleteTableContentsSQL(Table[] tables, Connection conn)
DBDictionary
getDeleteTableContentsSQL
in class DBDictionary
protected void appendSelectRange(SQLBuffer buf, long start, long end, boolean subselect)
DBDictionary
appendSelectRange
in class DBDictionary
protected Column newColumn(ResultSet colMeta) throws SQLException
DBDictionary
newColumn
in class DBDictionary
SQLException
public Object getBlobObject(ResultSet rs, int column, JDBCStore store) throws SQLException
DBDictionary
getBlobObject
in class DBDictionary
SQLException
public int getPreferredType(int type)
DBDictionary
Types
type for the given one. Returns
the given type by default.getPreferredType
in class DBDictionary
public void appendXmlComparison(SQLBuffer buf, String op, FilterValue lhs, FilterValue rhs, boolean lhsxml, boolean rhsxml)
appendXmlComparison
in class DBDictionary
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 comparisonlhsxml
- indicates whether the left operand maps to XMLrhsxml
- indicates whether the right operand maps to XMLpublic int getBatchFetchSize(int batchFetchSize)
getBatchFetchSize
in class DBDictionary
public String getSelectOperation(JDBCFetchConfiguration fetch)
SELECT_HINT
in the
fetch configuration, and if so, append the MySQL hint after the
"SELECT" part of the query.getSelectOperation
in class DBDictionary
protected Collection<String> getSelectTableAliases(Select sel)
getSelectTableAliases
in class DBDictionary
protected int matchErrorState(Map<Integer,Set<String>> errorStates, SQLException ex)
DBDictionary
matchErrorState
in class DBDictionary
errorStates
- classification of SQL error states by their specific nature. The keys of the
map represent one of the constants defined in StoreException
. The value corresponding to
a key represent the set of SQL Error States representing specific category of database error.
This supplied map is sourced from sql-error-state-codes.xml and filtered the
error states for the current database.
ex
- original SQL Exception as raised by the database driver.StoreException
.public boolean isFatalException(int subtype, SQLException ex)
DBDictionary
isFatalException
in class DBDictionary
subtype
- A constant indicating the category of error as defined in StoreException
.ex
- original SQL Exception as raised by the database driver.public String getTypeName(Column col)
getTypeName
in class DBDictionary
DBDictionary.getTypeName(org.apache.openjpa.jdbc.schema.Column)
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
DBDictionary
indexOf
in class DBDictionary
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 beginningCopyright © 2006–2018 Apache Software Foundation. All rights reserved.