SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

com.solarmetric.kodo.impl.jdbc.schema.dict
Class PostgresDictionary

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.schema.dict.GenericDictionary
        |
        +--com.solarmetric.kodo.impl.jdbc.schema.dict.PostgresDictionary
All Implemented Interfaces:
DBDictionary

public class PostgresDictionary
extends GenericDictionary

Implementation of the DBDictionary interface for Postgresql.


Fields inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.GenericDictionary
CENTI, DECI, meta, MICRO, MILLI, NANO, NUMBER_FORMAT, SEC
 
Constructor Summary
PostgresDictionary()
           
 
Method Summary
 Object blobFromSQL(ResultSet rs, int column)
           
 Date dateFromSQL(ResultSet rs, int column)
           
 Object dateToSQL(Date val)
           
 String[] getAddColumnSQL(Column column)
          PostgreSQL has special needs when altering PK columns.
protected  String getColumnDeclaration(Column column, boolean ignorePK)
          This method can be overridden if the database does not support standard column declarations, which are in the form: <column-name> <sql-type> [NOT NULL].
protected  int getDatePrecision()
          Return the precision to which dates are stored in this type of data store.
 String[] getDropColumnSQL(Column column)
          PostgreSQL can't deal with dropping columns.
 String getPlatform()
          Return the title of this database platform, used for display only.
 String getValidIndexName(String name)
          Limits index names to getMaxIndexNameLength()-1 plus an 'I' that is appended to the end of the given name to avoid SQL keyword conflicts.
protected  void setupSQLTypeMap(SQLTypeMap map)
          This is the most commonly overridden method when porting to a new database.
 String stringToSQL(String string)
          PostgreSQL seems to use '\' as a quote character as well as '.
 String toSelect(String[] cols, String[] tables, String where, String order, boolean distinct, boolean update)
          Appends the given pieces using standard SQL.
 
Methods inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.GenericDictionary
bigDecimalFromSQL, bigDecimalToPreparedParameter, bigDecimalToSQL, bigIntegerFromSQL, bigIntegerToPreparedParameter, bigIntegerToSQL, blobToPreparedParameter, blobToSQL, booleanFromSQL, booleanToPreparedParameter, booleanToSQL, byteFromSQL, byteToPreparedParameter, byteToSQL, characterToPreparedParameter, charFromSQL, charToSQL, clobFromSQL, clobToPreparedParameter, clobToSQL, colsToString, dateToPreparedParameter, dateToTimestamp, doubleFromSQL, doubleToPreparedParameter, doubleToSQL, floatFromSQL, floatToPreparedParameter, floatToSQL, fromSQL, getClassMappingCandidateClasses, getColumnDeclaration, getColumns, getCreateIndexSQL, getCreateTableSQL, getDBMetaData, getDropIndexSQL, getDropTableSQL, getFieldMappingCandidateClasses, getMaxColumnNameLength, getMaxIndexNameLength, getMaxTableNameLength, getNameTruncationVersion, getQuoteNumbers, getSchemaName, getSQLTypeMap, getTables, getValidColumnName, getValidTableName, intFromSQL, intToPreparedParameter, intToSQL, localeFromSQL, localeToPreparedParameter, localeToSQL, longFromSQL, longToPreparedParameter, longToSQL, objectFromSQL, objectToPreparedParameter, objectToSQL, setDBMetaData, setNameTruncationVersion, setQuoteNumbers, setSchemaName, shortFromSQL, shortToPreparedParameter, shortToSQL, stringFromSQL, stringToPreparedParameter, tablesToString, toPreparedParameter, toSelect, toSQL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PostgresDictionary

public PostgresDictionary()
Method Detail

getPlatform

public String getPlatform()
Description copied from class: GenericDictionary
Return the title of this database platform, used for display only.
Overrides:
getPlatform in class GenericDictionary

stringToSQL

public String stringToSQL(String string)
PostgreSQL seems to use '\' as a quote character as well as '.
Overrides:
stringToSQL in class GenericDictionary

dateToSQL

public Object dateToSQL(Date val)
Overrides:
dateToSQL in class GenericDictionary

setupSQLTypeMap

protected void setupSQLTypeMap(SQLTypeMap map)
Description copied from class: GenericDictionary
This is the most commonly overridden method when porting to a new database. Most databases have different mappings between java and SQL types; this method can be used to setup the mappings for the database being ported.
Overrides:
setupSQLTypeMap in class GenericDictionary

getDropColumnSQL

public String[] getDropColumnSQL(Column column)
PostgreSQL can't deal with dropping columns.
Overrides:
getDropColumnSQL in class GenericDictionary

getAddColumnSQL

public String[] getAddColumnSQL(Column column)
PostgreSQL has special needs when altering PK columns.
Overrides:
getAddColumnSQL in class GenericDictionary

getColumnDeclaration

protected String getColumnDeclaration(Column column,
                                      boolean ignorePK)
This method can be overridden if the database does not support standard column declarations, which are in the form: <column-name> <sql-type> [NOT NULL]. Where NOT NULL is appended if it is a primary key column.

toSelect

public String toSelect(String[] cols,
                       String[] tables,
                       String where,
                       String order,
                       boolean distinct,
                       boolean update)
Description copied from class: GenericDictionary
Appends the given pieces using standard SQL.
Overrides:
toSelect in class GenericDictionary
Following copied from interface: com.solarmetric.kodo.impl.jdbc.schema.DBDictionary
Parameters:
cols - list of values the columns to select
tables - list of the tables to select from
where - the WHERE conditions; may be null if none
order - the ORDER BY conditions; may be null if none
distinct - if true, this should be a SELECT DISTINCT-equivalent query
update - if true this should be a SELECT FOR UPDATE-equivalent query

blobFromSQL

public Object blobFromSQL(ResultSet rs,
                          int column)
                   throws SQLException
Overrides:
blobFromSQL in class GenericDictionary

dateFromSQL

public Date dateFromSQL(ResultSet rs,
                        int column)
                 throws SQLException
Overrides:
dateFromSQL in class GenericDictionary

getDatePrecision

protected int getDatePrecision()
Description copied from class: GenericDictionary
Return the precision to which dates are stored in this type of data store. Returns MILLI by default, as java.util.Date is only precise to the nearest millisecond. This value is used when generating timestamps to store in the data store. It is important that we never generate SQL data with greater precision than what will be returned to us, as otherwise we can get into awkward situations in which we cannot use retrieved values in where clauses since the data is not sufficiently precise. SQLServer behaves strangely here. It returns values whose millis are not accurate, but allows SELECT, DELETE statements using these non-accurate milli values. It must perform some internal rounding. Oracle, MySQL return values precise to the second on select, but will select/delete all values in a particular second, not just those values with exactly 0 nanos.
Overrides:
getDatePrecision in class GenericDictionary

getValidIndexName

public String getValidIndexName(String name)
Limits index names to getMaxIndexNameLength()-1 plus an 'I' that is appended to the end of the given name to avoid SQL keyword conflicts.
Overrides:
getValidIndexName in class GenericDictionary

SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.