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, org.apache.openjpa.lib.conf.Configurable, org.apache.openjpa.lib.jdbc.ConnectionDecorator, org.apache.openjpa.lib.jdbc.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.
Fields inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
allowsAliasInBulkClause, arrayTypeName, autoAssignClause, autoAssignTypeName, bigintTypeName, binaryTypeName, bitLengthFunction, bitTypeName, blobTypeName, booleanTypeName, castFunction, catalogSeparator, CENTI, characterColumnSize, charTypeName, clobTypeName, closePoolSQL, concatenateDelimiter, concatenateFunction, conf, connected, CONS_NAME_AFTER, CONS_NAME_BEFORE, CONS_NAME_MID, constraintNameMode, createPrimaryKeys, crossJoinClause, currentDateFunction, currentTimeFunction, currentTimestampFunction, datePrecision, dateTypeName, DECI, decimalTypeName, distinctCountColumnSeparator, distinctTypeName, doubleTypeName, driverVendor, dropTableSQL, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, initializationSQL, innerJoinClause, integerTypeName, javaObjectTypeName, joinSyntax, lastGeneratedKeyQuery, log, longVarbinaryTypeName, longVarcharTypeName, maxAutoAssignNameLength, maxColumnNameLength, maxConstraintNameLength, maxEmbeddedBlobSize, maxEmbeddedClobSize, maxIndexesPerTable, maxIndexNameLength, maxTableNameLength, MICRO, MILLI, NAME_ANY, NAME_SEQUENCE, NAME_TABLE, NANO, nextSequenceQuery, nullTypeName, numericTypeName, otherTypeName, outerJoinClause, platform, RANGE_POST_DISTINCT, RANGE_POST_SELECT, RANGE_PRE_DISTINCT, rangePosition, realTypeName, refTypeName, requiresAliasForSubselect, requiresAutoCommitForMetaData, requiresCastForComparisons, requiresCastForMathFunctions, requiresConditionForCrossJoin, reservedWords, reservedWordSet, SCHEMA_CASE_LOWER, SCHEMA_CASE_PRESERVE, SCHEMA_CASE_UPPER, schemaCase, searchStringEscape, SEC, simulateLocking, smallintTypeName, storageLimitationsFatal, storeCharsAsNumbers, storeLargeNumbersAsStrings, stringLengthFunction, structTypeName, substringFunctionName, supportsAlterTableWithAddColumn, supportsAlterTableWithDropColumn, supportsAutoAssign, supportsCascadeDeleteAction, supportsCascadeUpdateAction, supportsCorrelatedSubselect, supportsDefaultDeleteAction, supportsDefaultUpdateAction, supportsDeferredConstraints, supportsForeignKeys, supportsHaving, supportsLockingWithDistinctClause, supportsLockingWithInnerJoin, supportsLockingWithMultipleTables, supportsLockingWithOrderClause, supportsLockingWithOuterJoin, supportsLockingWithSelectRange, supportsModOperator, supportsMultipleNontransactionalResultSets, supportsNullDeleteAction, supportsNullTableForGetColumns, supportsNullTableForGetImportedKeys, supportsNullTableForGetIndexInfo, supportsNullTableForGetPrimaryKeys, supportsNullUpdateAction, supportsQueryTimeout, supportsRestrictDeleteAction, supportsRestrictUpdateAction, supportsSchemaForGetColumns, supportsSchemaForGetTables, supportsSelectEndIndex, supportsSelectForUpdate, supportsSelectStartIndex, supportsSubselect, supportsUniqueConstraints, systemSchemas, systemSchemaSet, systemTables, systemTableSet, tableForUpdateClause, tableTypes, timestampTypeName, timeTypeName, tinyintTypeName, toLowerCaseFunction, toUpperCaseFunction, trimBothFunction, trimLeadingFunction, trimTrailingFunction, useGetBestRowIdentifierForPrimaryKeys, useGetBytesForBlobs, useGetObjectForBlobs, useGetStringForClobs, useSchemaName, useSetBytesForBlobs, useSetStringForClobs, validationSQL, varbinaryTypeName, varcharTypeName, VENDOR_DATADIRECT, VENDOR_OTHER |
Method Summary |
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. |
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. |
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 the given value as a parameters to the statement. |
Methods inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
appendCast, appendNumericCast, appendSelectRange, appendUpdates, assertSupport, canOuterJoin, closeDataSource, comparison, connectedConfiguration, convertSchemaCase, decorate, endConfiguration, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getArray, getAsciiStream, getBigDecimal, getBigInteger, getBinaryStream, getBlob, getBlobObject, getBoolean, getByte, getBytes, getCalendar, getCatalogNameForMetadata, getChar, getCharacterStream, getClob, getClobString, getColumnNameForMetadata, getCreateSequenceSQL, getCreateTableSQL, getDate, getDate, getDeclareColumnSQL, getDouble, getDropColumnSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropSequenceSQL, getDropTableSQL, getFloat, getForeignKeyConstraintSQL, getFrom, getFromSelect, getFullName, getFullName, getFullName, getGeneratedKey, getGeneratedKeySequenceName, getImportedKeys, getIndexInfo, getInt, getJDBCType, getLocale, getLong, getNumber, getObject, getPlaceholderValueString, getPreferredType, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaNameForMetadata, getSelectOperation, getSelects, getSequences, getSequencesSQL, getShort, getTableNameForMetadata, getTables, getTime, getTimestamp, getTypeName, getTypeName, getUniqueConstraintSQL, getValidColumnName, getValidForeignKeyName, getValidIndexName, getValidPrimaryKeyName, getValidSequenceName, getValidTableName, getValidUniqueName, getWhere, handleWarning, indexOf, isSystemIndex, isSystemSequence, isSystemTable, makeNameValid, mathFunction, newColumn, newForeignKey, newIndex, newPrimaryKey, newSequence, newStoreException, newTable, putBytes, putChars, putString, refSchemaComponents, serialize, setArray, setAsciiStream, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setClobString, setConfiguration, setDate, setDate, setDouble, setFloat, setInt, setJoinSyntax, setLocale, setLong, setNumber, setObject, setRef, setShort, setString, setTime, setTimestamp, setTyped, setUnknown, shorten, startConfiguration, storageWarning, substring, supportsDeleteAction, supportsLocking, supportsRandomAccessResultSet, supportsUpdateAction, toBulkOperation, toDelete, toNativeJoin, toOperation, toSelect, toSelect, toSelectCount, toSQL92Join, toTraditionalJoin, toUpdate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FoxProDictionary
public FoxProDictionary()
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 class DBDictionary
- 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 the given value as a parameters to the statement. The column
type will come from
Types
.
- Overrides:
setNull
in class DBDictionary
- 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 the
fixedSizeTypeNameSet
).
- Overrides:
appendSize
in class DBDictionary
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 within
DBDictionary.getCreateTableSQL(org.apache.openjpa.jdbc.schema.Table)
and
DBDictionary.getAddPrimaryKeySQL(org.apache.openjpa.jdbc.schema.PrimaryKey)
. Returns
CONSTRAINT <pk name> PRIMARY KEY (<col list>)
by default.
- Overrides:
getPrimaryKeyConstraintSQL
in class DBDictionary
getCreateIndexSQL
public java.lang.String[] getCreateIndexSQL(Index index)
- Description copied from class:
DBDictionary
- Return a series of SQL statements to create the given index. Returns
CREATE [UNIQUE] INDEX <index name> ON <table name>
(<col list>)
by default.
- Overrides:
getCreateIndexSQL
in class DBDictionary
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 class DBDictionary
- 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 class DBDictionary
- Throws:
java.sql.SQLException
Copyright © 2006 Apache Software Foundation. All Rights Reserved.