kodo.jdbc.sql
Class PostgresDictionary
java.lang.Object
|
+--kodo.jdbc.sql.DBDictionary
|
+--kodo.jdbc.sql.PostgresDictionary
- All Implemented Interfaces:
- Configurable, ConnectionDecorator
- public class PostgresDictionary
- extends DBDictionary
Dictionary for Postgres.
|
Method Summary |
Connection |
decorate(Connection conn)
Decorate the given connection if needed. |
byte |
getByte(ResultSet rs,
int column)
PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a SQLException. |
Date |
getDate(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper
java type. |
protected int |
getDatePrecision()
Set to the precision of timestamps in the data store. |
String[] |
getDropColumnSQL()
|
protected String |
getGeneratedKeySequenceName(Column col)
Return the sequence name used by postgres for the given serial
column. |
int |
getInt(ResultSet rs,
int column)
PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a SQLException. |
String |
getLastGeneratedKeyQuery(Column column)
|
long |
getLong(ResultSet rs,
int column)
PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a SQLException. |
int |
getPreferredType(int type)
Return the preferred Types type for the given one. |
short |
getShort(ResultSet rs,
int column)
PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a SQLException. |
boolean |
isSystemIndex(String name,
Table table)
This method is used to filter system indexes from database metadata. |
boolean |
isSystemTable(String name,
String schema,
boolean targetSchema)
This method is used to filter system tables from database metadata. |
void |
setBoolean(PreparedStatement stmnt,
int idx,
boolean val)
Set the given value as a parameter to the statement. |
void |
setSupportsSetFetchSize(boolean supports)
|
boolean |
supportsAutoIncrement()
Return true if this dictionary supports auto increment columns. |
boolean |
supportsSetFetchSize()
|
protected boolean |
supportsSizeInColumnDefinition(Column col,
String name)
Returns true if a schema definition statement supports appending
the size after the column type. |
| Methods inherited from class kodo.jdbc.sql.DBDictionary |
addSystemSchema, addSystemTable, appendSize, canBatch, canLock, configureReflectedColumn, convertSchemaCase, endConfiguration, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getArray, getAsciiStream, getAutoIncrementClause, getAutoIncrementTypeName, getBatchLimit, getBatchParameterLimit, getBigDecimal, getBigInteger, getBigintTypeName, getBinaryStream, getBinaryTypeName, getBitTypeName, getBlob, getBlobObject, getBlobStream, getBlobTypeName, getBoolean, getBytes, getCatalogNameForMetadata, getCatalogSeparator, getChar, getCharacterStream, getCharTypeName, getClob, getClobString, getClobTypeName, getColumnNameForMetadata, getColumns, getConfiguration, getConstraintNameBeforeDeclaration, getCreateIndexSQL, getCreatePrimaryKeys, getCreateTableSQL, getDate, getDateTypeName, getDBMetaData, getDecimalTypeName, getDeclareColumnSQL, getDistinctTypeName, getDouble, getDoubleTypeName, getDropColumnSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropTableSQL, getFloat, getFloatTypeName, getForeignKeyActionName, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFullName, getFullName, getGeneratedKey, getImportedKeys, getIndexInfo, getInitializationSQL, getIntegerTypeName, getJavaObjectTypeName, getJDBCType, getJoinSyntax, getJoinSyntaxConstant, getLastGeneratedKeyQuery, getLocale, getLongVarbinaryTypeName, getLongVarcharTypeName, getMaxCharacterFieldLength, getMaxColumnNameLength, getMaxForeignKeyNameLength, getMaxIndexesPerTable, getMaxIndexNameLength, getMaxKeyNameLength, getMaxPrimaryKeyNameLength, getMaxTableNameLength, getNullTypeName, getNumericTypeName, getObject, getOrderings, getOtherTypeName, getPlatform, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getRealTypeName, getRef, getRefTypeName, getReservedKeywords, getReservedWords, getSchemaCase, getSchemaNameForMetadata, getSelects, getSimulateLocking, getSizeClause, getSmallintTypeName, getStorageLimitationsFatal, getStoreCharsAsNumbers, getStoreLargeNumbersAsStrings, getString, getStructTypeName, getSupportsDeferredConstraints, getSupportsForeignKeys, getSupportsLockingWithDistinctClause, getSupportsLockingWithInnerJoin, getSupportsLockingWithMultipleTables, getSupportsLockingWithOrderClause, getSupportsLockingWithOuterJoin, getSupportsMultipleNontransactionalResultSets, getSupportsNullTableForGetColumns, getSupportsNullTableForGetImportedKeys, getSupportsNullTableForGetIndexInfo, getSupportsNullTableForGetPrimaryKeys, getSupportsSchemaForGetColumns, getSupportsSchemaForGetTables, getSupportsSelectForUpdate, getSystemSchemas, getSystemTables, getTableForUpdateClause, getTableNameForMetadata, getTables, getTableTypes, getTime, getTimestamp, getTimestampTypeName, getTimeTypeName, getTinyintTypeName, getTypeName, getUseGetBestRowIdentifierForPrimaryKeys, getUseGetBytesForBlobs, getUseGetObjectForBlobs, getUseSchemaName, getUseSetBytesForBlobs, getUseStringsForClobs, getValidationSQL, getValidColumnName, getValidForeignKeyName, getValidIndexName, getValidPrimaryKeyName, getValidTableName, getVarbinaryTypeName, getVarcharTypeName, getWhere, isReserved, isSupported, makeNameValid, maxKeyNameLength, newColumnInfo, newForeignKeyInfo, newIndexInfo, newPrimaryKeyInfo, newTableInfo, refSchemaComponents, replaceMapping, replaceMapping, replaceMappingFactory, replaceSchemaFactory, replaceSize, serialize, setArray, setAsciiStream, setAutoIncrementClause, setAutoIncrementTypeName, setBatchLimit, setBatchParameterLimit, setBigDecimal, setBigInteger, setBigintTypeName, setBinaryStream, setBinaryTypeName, setBitTypeName, setBlob, setBlobObject, setBlobTypeName, setByte, setBytes, setCatalogSeparator, setChar, setCharacterStream, setCharTypeName, setClob, setClobString, setClobTypeName, setConfiguration, setCreatePrimaryKeys, setDate, setDate, setDateTypeName, setDBMetaData, setDecimalTypeName, setDistinctTypeName, setDouble, setDoubleTypeName, setFloat, setFloatTypeName, setForUpdateClause, setInitializationSQL, setInt, setIntegerTypeName, setJavaObjectTypeName, setJoinSyntax, setJoinSyntaxConstant, setLastGeneratedKeyQuery, setLocale, setLong, setLongVarbinaryTypeName, setLongVarcharTypeName, setMaxIndexesPerTable, setMaxKeyNameLength, setNull, setNullTypeName, setNumericTypeName, setObject, setOtherTypeName, setPlatform, setRealTypeName, setRef, setRefTypeName, setReservedWords, setSchemaCase, setShort, setSimulateLocking, setSmallintTypeName, setStorageLimitationsFatal, setStoreCharsAsNumbers, setStoreLargeNumbersAsStrings, setString, setStructTypeName, setSupportsDeferredConstraints, setSupportsForeignKeys, setSupportsLockingWithDistinctClause, setSupportsLockingWithInnerJoin, setSupportsLockingWithMultipleTables, setSupportsLockingWithOrderClause, setSupportsLockingWithOuterJoin, setSupportsMultipleNontransactionalResultSets, setSupportsNullTableForGetColumns, setSupportsNullTableForGetImportedKeys, setSupportsNullTableForGetIndexInfo, setSupportsNullTableForGetPrimaryKeys, setSupportsSchemaForGetColumns, setSupportsSchemaForGetTables, setSupportsSelectForUpdate, setSystemSchemas, setSystemTables, setTableForUpdateClause, setTableTypes, setTime, setTimestamp, setTimestampTypeName, setTimeTypeName, setTinyintTypeName, setup, setUseGetBestRowIdentifierForPrimaryKeys, setUseGetBytesForBlobs, setUseGetObjectForBlobs, setUseSchemaName, setUseSetBytesForBlobs, setUseStringsForClobs, setValidationSQL, setVarbinaryTypeName, setVarcharTypeName, startConfiguration, storageWarning, supportsForeignKey, supportsSelectForUpdate, supportsTotalCountsForBatch, supportsUpdateCountsForBatch, toNativeJoin, toSelect, toSelect, toSQL92Join, toTraditionalJoin, warnSupportedDictionary |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PostgresDictionary
public PostgresDictionary()
getDate
public Date getDate(ResultSet rs,
int column)
throws SQLException
- Description copied from class:
DBDictionary
- Convert the specified column of the SQL ResultSet to the proper
java type. Converts the date from a
Timestamp by default.
- Overrides:
getDate in class DBDictionary
getByte
public byte getByte(ResultSet rs,
int column)
throws SQLException
- PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a
SQLException.
Fall back to performing manual conversion if the initial get fails.
- Overrides:
getByte in class DBDictionary
getShort
public short getShort(ResultSet rs,
int column)
throws SQLException
- PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a
SQLException.
Fall back to performing manual conversion if the initial get fails.
- Overrides:
getShort in class DBDictionary
getInt
public int getInt(ResultSet rs,
int column)
throws SQLException
- PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a
SQLException.
Fall back to performing manual conversion if the initial get fails.
- Overrides:
getInt in class DBDictionary
getLong
public long getLong(ResultSet rs,
int column)
throws SQLException
- PostgreSQL does not perform automatic conversions, so attempting to
get a whole number out of a decimal will throw a
SQLException.
Fall back to performing manual conversion if the initial get fails.
- Overrides:
getLong in class DBDictionary
getDatePrecision
protected int getDatePrecision()
- Description copied from class:
DBDictionary
- Set to the precision of timestamps in the data store. Set to one of:
DBDictionary.NANO, DBDictionary.MICRO, DBDictionary.MILLI, DBDictionary.CENTI,
DBDictionary.DECI, DBDictionary.SEC. Returns DBDictionary.MILLI by default.
- Overrides:
getDatePrecision in class DBDictionary
getDropColumnSQL
public String[] getDropColumnSQL()
getPreferredType
public int getPreferredType(int type)
- Description copied from class:
DBDictionary
- Return the preferred
Types type for the given one. Returns
the given type by default.
- Overrides:
getPreferredType in class DBDictionary
supportsSizeInColumnDefinition
protected boolean supportsSizeInColumnDefinition(Column col,
String name)
- Description copied from class:
DBDictionary
- Returns true if a schema definition statement supports appending
the size after the column type. For example some databases
allow FLOAT(20), but other databases disallow INT8(16).
- Overrides:
supportsSizeInColumnDefinition in class DBDictionary
setBoolean
public void setBoolean(PreparedStatement stmnt,
int idx,
boolean val)
throws SQLException
- Description copied from class:
DBDictionary
- Set the given value as a parameter to the statement.
- Overrides:
setBoolean in class DBDictionary
supportsAutoIncrement
public boolean supportsAutoIncrement()
- Description copied from class:
DBDictionary
- Return true if this dictionary supports auto increment columns.
Returns false by default.
- Overrides:
supportsAutoIncrement in class DBDictionary
getLastGeneratedKeyQuery
public String getLastGeneratedKeyQuery(Column column)
- Overrides:
getLastGeneratedKeyQuery in class DBDictionary
getGeneratedKeySequenceName
protected String getGeneratedKeySequenceName(Column col)
- Return the sequence name used by postgres for the given serial
column.
decorate
public Connection decorate(Connection conn)
throws SQLException
- Description copied from class:
DBDictionary
- Decorate the given connection if needed. Some databases require special
handling for JDBC bugs. This method will also issue any
initialization SQL is the
DBDictionary.getInitializationSQL() method does
not return null.
- Overrides:
decorate in class DBDictionary
isSystemTable
public boolean isSystemTable(String name,
String schema,
boolean targetSchema)
- Description copied from class:
DBDictionary
- This method is used to filter system tables from database metadata.
Return true if the given table name represents a system table that
should not appear in the schema definition. By default, returns
true only if the given table is in the internal list of system tables,
or if the given schema is in the list of system schemas and is not
the target schema.
- Overrides:
isSystemTable in class DBDictionary
- Following copied from class:
kodo.jdbc.sql.DBDictionary
- 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 JDO schemas
isSystemIndex
public boolean isSystemIndex(String name,
Table table)
- Description copied from class:
DBDictionary
- This 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:
isSystemIndex in class DBDictionary
- Following copied from class:
kodo.jdbc.sql.DBDictionary
- Parameters:
name - the index nametable - the index table
supportsSetFetchSize
public boolean supportsSetFetchSize()
setSupportsSetFetchSize
public void setSupportsSetFetchSize(boolean supports)
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.