Package org.apache.openjpa.jdbc.sql
Class FoxProDictionary
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.DBDictionary
-
- org.apache.openjpa.jdbc.sql.FoxProDictionary
-
- All Implemented Interfaces:
JoinSyntaxes
,Configurable
,IdentifierConfiguration
,ConnectionDecorator
,LoggingConnectionDecorator.SQLWarningHandler
public class FoxProDictionary extends DBDictionary
Dictionary for Visual FoxPro via DataDirect SequeLink and DataDirect ODBC FoxPro driver. This will not work with any other combination of JDBC/ODBC server and ODBC driver. FoxPro has the following limitations:- Primary Keys and indexes cannot be created via JDBC
- Only has fixed-length char fields: all strings must be trimmed in result sets
- Does not have sufficient support for foreign keys
- ODBC driver cannot handle certain Aggregate functions.
- Locking is extremeley unreliable. Multiple clients accessing single datastore may result in concurrency data validity errors.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData
-
-
Field Summary
-
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 FoxProDictionary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
appendSize(Column col, java.lang.String typeName)
Helper method to add size properties to the specified type.Column[]
getColumns(java.sql.DatabaseMetaData meta, java.lang.String catalog, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, java.sql.Connection conn)
Reflect on the schema to find columns matching the given table and column patterns.Column[]
getColumns(java.sql.DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, DBIdentifier columnName, java.sql.Connection conn)
Reflect on the schema to find columns matching the given table and column patterns.java.lang.String[]
getCreateIndexSQL(Index index)
Return a series of SQL statements to create the given index.protected java.lang.String
getPrimaryKeyConstraintSQL(PrimaryKey pk)
Return the declaration SQL for the given primary key.PrimaryKey[]
getPrimaryKeys(java.sql.DatabaseMetaData meta, java.lang.String catalog, java.lang.String schemaName, java.lang.String tableName, java.sql.Connection conn)
Reflect on the schema to find primary keys for the given table pattern.PrimaryKey[]
getPrimaryKeys(java.sql.DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, java.sql.Connection conn)
Reflect on the schema to find primary keys for the given table pattern.java.lang.String
getString(java.sql.ResultSet rs, int column)
Convert the specified column of the SQL ResultSet to the proper java type.void
setNull(java.sql.PreparedStatement stmnt, int idx, int colType, Column col)
Set null as a parameter to the statement.-
Methods inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
addCastAsType, addErrorCode, appendCast, appendLength, appendNumericCast, appendSelect, appendSelectRange, appendUpdates, appendXmlComparison, applyRange, assertSupport, calculateValue, canOuterJoin, closeDataSource, combineForeignKey, comment, comparison, configureNamingRules, connectedConfiguration, convertSchemaCase, convertSchemaCase, copy, copy, createIndexIfNecessary, createIndexIfNecessary, decorate, deleteStream, delimitAll, endConfiguration, 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, getConversionKey, getCreateSequenceSQL, getCreateTableSQL, 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, getGenKeySeqName, 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, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelectOperation, getSelects, getSelectTableAliases, getSequence, getSequences, getSequences, getSequencesSQL, getSequencesSQL, getShort, getStoredProcedure, 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, indexOf, insertBlobForStreamingLoad, insertClobForStreamingLoad, insertSize, isFatalException, isImplicitJoin, isSelect, isSystemIndex, isSystemIndex, isSystemSequence, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, makeNameValid, makeNameValid, makeNameValid, makeNameValid, matchErrorState, mathFunction, needsToCreateIndex, needsToCreateIndex, newColumn, newForeignKey, newIndex, newPrimaryKey, newSequence, newStoreException, newTable, prepareStatement, processDBColumnName, 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, setDelimitedCase, setDelimitIdentifiers, setDouble, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocalDate, setLocalDateTime, setLocale, setLocalTime, setLong, setMajorVersion, setMinorVersion, setNumber, setObject, setOffsetDateTime, setOffsetTime, 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, toSnakeCase, toSQL92Join, toTraditionalJoin, toUpdate, updateBlob, updateClob, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
-
-
-
-
Method Detail
-
getString
public java.lang.String getString(java.sql.ResultSet rs, int column) throws java.sql.SQLException
Description copied from class:DBDictionary
Convert the specified column of the SQL ResultSet to the proper java type.- Overrides:
getString
in classDBDictionary
- Throws:
java.sql.SQLException
-
setNull
public void setNull(java.sql.PreparedStatement stmnt, int idx, int colType, Column col) throws java.sql.SQLException
Description copied from class:DBDictionary
Set null as a parameter to the statement. The column type will come fromTypes
.- Overrides:
setNull
in classDBDictionary
- Throws:
java.sql.SQLException
-
appendSize
protected java.lang.String appendSize(Column col, java.lang.String typeName)
Description copied from class:DBDictionary
Helper method to add size properties to the specified type. If present, the string "{0}" will be replaced with the size definition; otherwise the size definition will be appended to the type name. If your database has column types that don't allow size definitions, override this method to return the unaltered type name for columns of those types (or add the type names to thefixedSizeTypeNameSet
).Some databases support "type modifiers", for example the unsigned "modifier" in MySQL. In these cases the size should go between the type and the "modifier", instead of after the modifier. For example CREATE table FOO ( myint INT (10) UNSIGNED . . .) instead of CREATE table FOO ( myint INT UNSIGNED (10) . . .). Type modifiers should be added to
typeModifierSet
in subclasses.- Overrides:
appendSize
in classDBDictionary
-
getPrimaryKeyConstraintSQL
protected java.lang.String getPrimaryKeyConstraintSQL(PrimaryKey pk)
Description copied from class:DBDictionary
Return the declaration SQL for the given primary key. This method is used from withinDBDictionary.getCreateTableSQL(org.apache.openjpa.jdbc.schema.Table, org.apache.openjpa.jdbc.schema.SchemaGroup)
andDBDictionary.getAddPrimaryKeySQL(org.apache.openjpa.jdbc.schema.PrimaryKey)
. ReturnsCONSTRAINT <pk name> PRIMARY KEY (<col list>)
by default.- Overrides:
getPrimaryKeyConstraintSQL
in classDBDictionary
-
getCreateIndexSQL
public java.lang.String[] getCreateIndexSQL(Index index)
Description copied from class:DBDictionary
Return a series of SQL statements to create the given index. ReturnsCREATE [UNIQUE] INDEX <index name> ON <table name> (<col list>)
by default.- Overrides:
getCreateIndexSQL
in classDBDictionary
-
getColumns
public Column[] getColumns(java.sql.DatabaseMetaData meta, java.lang.String catalog, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, java.sql.Connection conn) throws java.sql.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:
java.sql.SQLException
-
getColumns
public Column[] getColumns(java.sql.DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, DBIdentifier columnName, java.sql.Connection conn) throws java.sql.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:
java.sql.SQLException
-
getPrimaryKeys
public PrimaryKey[] getPrimaryKeys(java.sql.DatabaseMetaData meta, java.lang.String catalog, java.lang.String schemaName, java.lang.String tableName, java.sql.Connection conn) throws java.sql.SQLException
Description copied from class:DBDictionary
Reflect on the schema to find primary keys for the given table pattern.- Overrides:
getPrimaryKeys
in classDBDictionary
- Throws:
java.sql.SQLException
-
getPrimaryKeys
public PrimaryKey[] getPrimaryKeys(java.sql.DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, java.sql.Connection conn) throws java.sql.SQLException
Description copied from class:DBDictionary
Reflect on the schema to find primary keys for the given table pattern.- Overrides:
getPrimaryKeys
in classDBDictionary
- Throws:
java.sql.SQLException
-
-