Package org.apache.openjpa.jdbc.sql
Class SolidDBDictionary
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.DBDictionary
-
- org.apache.openjpa.jdbc.sql.SolidDBDictionary
-
- All Implemented Interfaces:
JoinSyntaxes,Configurable,IdentifierConfiguration,ConnectionDecorator,LoggingConnectionDecorator.SQLWarningHandler
public class SolidDBDictionary extends DBDictionary
Dictionary for SolidDB database.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringautoAssignSequenceNameThe global sequence name to use for auto-assign simulation.java.lang.StringlockingModePossible values for LockingMode are "PESSIMISTIC" and "OPTIMISTIC"booleanopenjpa3GeneratedKeyNamesFlag to use OpenJPA 0.3 style naming for auto assign sequence name and trigger name for backwards compatibility.booleanstoreIsMemorySets whether tables are to be located in-memory or on disk.booleanuseTriggersForAutoAssignIf true, then simulate auto-assigned values in SolidDB by using a trigger that inserts a sequence value into the primary key value when a row is inserted.-
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
Constructors Constructor Description SolidDBDictionary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendSelect(SQLBuffer selectSQL, java.lang.Object alias, Select sel, int idx)AppendelemtoselectSQL.java.lang.StringconvertSchemaCase(DBIdentifier objectName)Convert the specified schema name to a name that the database will be able to understand.voidendConfiguration()Invoked upon completion of bean property configuration for this object.protected java.lang.StringgetAutoGenSeqName(Column col)java.lang.String[]getCreateTableSQL(Table table, SchemaGroup group)Return a series of SQL statements to create the given table, complete with columns.protected java.lang.StringgetGeneratedKeyTriggerName(Column col)Trigger name for simulating auto-assign values on the given column.protected java.lang.StringgetGenKeySeqName(java.lang.String query, Column col)protected java.lang.StringgetOpenJPA3GeneratedKeySequenceName(Column col)Returns a OpenJPA 3-compatible name for an auto-assign sequence.protected java.lang.StringgetOpenJPA3GeneratedKeyTriggerName(Column col)Returns a OpenJPA 3-compatible name for an auto-assign trigger.protected java.lang.StringgetSequencesSQL(java.lang.String schemaName, java.lang.String sequenceName)Return the SQL needed to select the list of sequences.protected java.lang.StringgetSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)voidindexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)Invoke this database's indexOf function.booleanisFatalException(int subtype, java.sql.SQLException ex)Determine if the given SQL Exception is fatal or recoverable (such as a timeout).booleanisSystemIndex(DBIdentifier name, Table table)This method is used to filter system indexes from database metadata.booleanisSystemSequence(DBIdentifier name, DBIdentifier schema, boolean targetSchema)This method is used to filter system sequences from database metadata.booleanneedsToCreateIndex(Index idx, Table table, Unique[] uniques)protected ForeignKeynewForeignKey(java.sql.ResultSet fkMeta)Solid does not support deferred referential integrity checking.protected booleansequenceExists(java.lang.String schemaName, java.lang.String seqName, SchemaGroup group)voidsetBigDecimal(java.sql.PreparedStatement stmnt, int idx, java.math.BigDecimal val, Column col)Set the given value as a parameter to the statement.voidsetDouble(java.sql.PreparedStatement stmnt, int idx, double val, Column col)Set the given value as a parameter to the statement.voidsubstring(SQLBuffer buf, FilterValue str, FilterValue start, FilterValue length)Invoke this database's substring function.-
Methods inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
addCastAsType, addErrorCode, appendCast, appendLength, appendNumericCast, appendSelectRange, appendSize, appendUpdates, appendXmlComparison, applyRange, assertSupport, calculateValue, canOuterJoin, closeDataSource, combineForeignKey, comment, comparison, configureNamingRules, connectedConfiguration, convertSchemaCase, copy, copy, createIndexIfNecessary, createIndexIfNecessary, decorate, deleteStream, delimitAll, executeQuery, fromDBName, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getAlterSequenceSQL, getArray, getAsciiStream, getBatchFetchSize, getBatchLimit, getBatchUpdateCount, getBigDecimal, getBigInteger, getBinaryStream, getBlob, getBlobObject, 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, getDeleteTableContentsSQL, getDeleteTargets, getDelimitedCase, getDelimitIdentifiers, getDouble, getDropColumnSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropSequenceSQL, getDropTableSQL, getFloat, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFromSelect, getFullIdentifier, getFullName, getFullName, getFullName, getGeneratedKey, getGeneratedKeySequenceName, getIdentifierConcatenator, getIdentifierDelimiter, getIdentifierRule, getIdentifierRules, getIdentityColumnName, getImportedKeys, getImportedKeys, getImportedKeys, getImportedKeys, getIndexInfo, getIndexInfo, getInt, getInvalidColumnWordSet, getIsNotNullSQL, getIsNullSQL, getJDBCType, getJDBCType, getJDBCType, getKey, getLeadingDelimiter, getLOBStream, getLocalDate, getLocalDateTime, getLocale, getLocalTime, getLog, getLong, getMajorVersion, getMarkerForInsertUpdate, getMillisecondBehavior, getMinorVersion, getNamingUtil, getNumber, getObject, getOffsetDateTime, getOffsetTime, getPlaceholderValueString, getPreferredType, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelectOperation, getSelects, getSelectTableAliases, getSequence, getSequences, getSequences, getShort, getStoredProcedure, getString, getSupportsDelimitedIdentifiers, getSupportsXMLColumn, getTableNameForMetadata, getTableNameForMetadata, getTables, getTables, getTime, getTimestamp, 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, insertBlobForStreamingLoad, insertClobForStreamingLoad, insertSize, isImplicitJoin, isSelect, isSystemIndex, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, makeNameValid, makeNameValid, makeNameValid, makeNameValid, matchErrorState, mathFunction, needsToCreateIndex, newColumn, newIndex, newPrimaryKey, newSequence, newStoreException, newTable, prepareStatement, processDBColumnName, putBytes, putChars, putString, refSchemaComponents, serialize, setArray, setAsciiStream, setBatchLimit, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setBooleanRepresentation, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setClobString, setConfiguration, setDate, setDate, setDateMillisecondBehavior, setDefaultSchemaName, setDelimitedCase, setDelimitIdentifiers, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocalDate, setLocalDateTime, setLocale, setLocalTime, setLong, setMajorVersion, setMinorVersion, setNull, setNumber, setObject, setOffsetDateTime, setOffsetTime, setQueryTimeout, setRef, setShort, setStatementQueryTimeout, setString, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setUnknown, setXMLTypeEncoding, shorten, startConfiguration, storageWarning, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsIsolationForUpdate, supportsLocking, supportsRandomAccessResultSet, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toNativeJoin, toOperation, toOperation, toSelect, toSelect, toSelect, toSelect, toSelect, toSelectCount, toSnakeCase, toSQL92Join, toTraditionalJoin, toUpdate, updateBlob, updateClob, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
-
-
-
-
Field Detail
-
storeIsMemory
public boolean storeIsMemory
Sets whether tables are to be located in-memory or on disk. Creating in-memory tables should append "STORE MEMORY" to the "CREATE TABLE" statement. Creating disk-based tables should append "STORE DISK". Since cursor hold over commit can not apply to M-tables (which will cause SOLID Table Error 13187: The cursor cannot continue accessing M-tables after the transaction has committed or aborted. The statement must be re-executed.), the default is STORE DISK. The default concurrency control mechanism depends on the table type: Disk-based tables (D-tables) are by default optimistic. Main-memory tables (M-tables) are always pessimistic. Since OpenJPA applications expects lock waits (as usually is done with normal pessimistic databases), the server should be set to the pessimistic mode. The optimistic mode is about not waiting for the locks at all. That increases concurrency but requires more programming. The pessimistic mode with the READ COMMITTED isolation level (default) should get as much concurrency as one might need. The pessimistic locking mode can be set in solid.ini: [General] Pessimistic=yes
-
useTriggersForAutoAssign
public boolean useTriggersForAutoAssign
If true, then simulate auto-assigned values in SolidDB by using a trigger that inserts a sequence value into the primary key value when a row is inserted.
-
autoAssignSequenceName
public java.lang.String autoAssignSequenceName
The global sequence name to use for auto-assign simulation.
-
openjpa3GeneratedKeyNames
public boolean openjpa3GeneratedKeyNames
Flag to use OpenJPA 0.3 style naming for auto assign sequence name and trigger name for backwards compatibility.
-
lockingMode
public java.lang.String lockingMode
Possible values for LockingMode are "PESSIMISTIC" and "OPTIMISTIC"
-
-
Method Detail
-
endConfiguration
public void endConfiguration()
Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable- Overrides:
endConfigurationin classDBDictionary
-
getCreateTableSQL
public java.lang.String[] getCreateTableSQL(Table table, SchemaGroup group)
Description copied from class:DBDictionaryReturn a series of SQL statements to create the given table, complete with columns. Indexes and constraints will be created separately.- Overrides:
getCreateTableSQLin classDBDictionary
-
sequenceExists
protected boolean sequenceExists(java.lang.String schemaName, java.lang.String seqName, SchemaGroup group)
-
getGeneratedKeyTriggerName
protected java.lang.String getGeneratedKeyTriggerName(Column col)
Trigger name for simulating auto-assign values on the given column.
-
getOpenJPA3GeneratedKeySequenceName
protected java.lang.String getOpenJPA3GeneratedKeySequenceName(Column col)
Returns a OpenJPA 3-compatible name for an auto-assign sequence.
-
getOpenJPA3GeneratedKeyTriggerName
protected java.lang.String getOpenJPA3GeneratedKeyTriggerName(Column col)
Returns a OpenJPA 3-compatible name for an auto-assign trigger.
-
getAutoGenSeqName
protected java.lang.String getAutoGenSeqName(Column col)
-
getGenKeySeqName
protected java.lang.String getGenKeySeqName(java.lang.String query, Column col)- Overrides:
getGenKeySeqNamein classDBDictionary
-
convertSchemaCase
public java.lang.String convertSchemaCase(DBIdentifier objectName)
Description copied from class:DBDictionaryConvert the specified schema name to a name that the database will be able to understand.- Overrides:
convertSchemaCasein classDBDictionary
-
substring
public void substring(SQLBuffer buf, FilterValue str, FilterValue start, FilterValue length)
Description copied from class:DBDictionaryInvoke this database's substring function. Numeric parameters are inlined if possible. This is to handle grouping by SUBSTRING - most databases do not allow parameter binding in this case.- Overrides:
substringin classDBDictionary- Parameters:
buf- the SQL buffer to write the substring invocation tostr- a query value representing the target stringstart- a query value representing the start indexlength- a query value representing the length of substring, or null for none
-
indexOf
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
Description copied from class:DBDictionaryInvoke this database's indexOf function.- Overrides:
indexOfin 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
-
isSystemIndex
public boolean isSystemIndex(DBIdentifier name, Table table)
Description copied from class:DBDictionaryThis method is used to filter system indexes from database metadata. Return true if the given index name represents a system index that should not appear in the schema definition. Returns false by default.- Overrides:
isSystemIndexin classDBDictionary- Parameters:
name- the index nametable- the index table
-
isSystemSequence
public boolean isSystemSequence(DBIdentifier name, DBIdentifier schema, boolean targetSchema)
Description copied from class:DBDictionaryThis 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:
isSystemSequencein 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
-
setBigDecimal
public void setBigDecimal(java.sql.PreparedStatement stmnt, int idx, java.math.BigDecimal val, Column col) throws java.sql.SQLExceptionDescription copied from class:DBDictionarySet the given value as a parameter to the statement.- Overrides:
setBigDecimalin classDBDictionary- Throws:
java.sql.SQLException
-
setDouble
public void setDouble(java.sql.PreparedStatement stmnt, int idx, double val, Column col) throws java.sql.SQLExceptionDescription copied from class:DBDictionarySet the given value as a parameter to the statement.- Overrides:
setDoublein classDBDictionary- Throws:
java.sql.SQLException
-
needsToCreateIndex
public boolean needsToCreateIndex(Index idx, Table table, Unique[] uniques)
- Overrides:
needsToCreateIndexin classDBDictionary
-
getSequencesSQL
protected java.lang.String getSequencesSQL(java.lang.String schemaName, java.lang.String sequenceName)Description copied from class:DBDictionaryReturn the SQL needed to select the list of sequences.- Overrides:
getSequencesSQLin classDBDictionary
-
getSequencesSQL
protected java.lang.String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
- Overrides:
getSequencesSQLin classDBDictionary
-
appendSelect
protected void appendSelect(SQLBuffer selectSQL, java.lang.Object alias, Select sel, int idx)
Description copied from class:DBDictionaryAppendelemtoselectSQL.- Overrides:
appendSelectin classDBDictionary- Parameters:
selectSQL- The SQLBuffer to append to.alias- ASQLBufferor aStringto append.
-
newForeignKey
protected ForeignKey newForeignKey(java.sql.ResultSet fkMeta) throws java.sql.SQLException
Solid does not support deferred referential integrity checking.- Overrides:
newForeignKeyin classDBDictionary- Throws:
java.sql.SQLException
-
isFatalException
public boolean isFatalException(int subtype, java.sql.SQLException ex)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.
-
-