|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
|
+--com.solarmetric.kodo.impl.jdbc.schema.dict.PostgresDictionary
Implementation of DBDictionary for PostgreSQL. This dictionary
contains workaround for various issues with the postgres JDBC driver.
Most notably, the official Postgres JDBC driver cannot handle
strings of length 0, either in normal or prepared statements. Thus,
we need to set the String to something (we use "null").
| Fields inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary |
CENTI, DECI, meta, MICRO, MILLI, NANO, NUMBER_FORMAT, SEC |
| Constructor Summary | |
PostgresDictionary()
|
|
| Method Summary | |
(package private) static void |
|
Object |
blobFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
void |
booleanToPreparedParameter(PreparedStatement st,
int index,
Boolean val)
|
void |
characterToPreparedParameter(PreparedStatement st,
int index,
Character val)
|
void |
clobToPreparedParameter(PreparedStatement st,
int index,
Object val)
|
Date |
dateFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
dateToSQL(Date val)
Convert data into SQL for the current database platform. |
SQLBuffer[] |
getAddColumnSQL(Column column)
PostgreSQL has special needs when altering PK columns. |
protected String |
getAutoIncrementSequence(Column col)
Returns the auto-increment sequence name created by Postgres for col. |
protected SQLBuffer |
getColumnDeclaration(Column column)
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 SQLBuffer |
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. |
SQLBuffer[] |
getDropColumnSQL(Column column)
PostgreSQL can't deal with dropping columns. |
long |
getNextAutoIncrementValue(Table table,
SQLExecutionManager sqlem)
Returns the next auto-increment value for a given table. |
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 '. |
boolean |
supportsAutoIncrement()
Returns true if this dictionary / database
combination supports auto-incrementing primary-key columns. |
SQLBuffer |
toSelect(String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
Appends the given pieces using standard SQL. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PostgresDictionary()
| Method Detail |
static void()
public String getPlatform()
AbstractDictionarygetPlatform in class AbstractDictionarypublic String stringToSQL(String string)
stringToSQL in class AbstractDictionary
public void clobToPreparedParameter(PreparedStatement st,
int index,
Object val)
throws SQLException
clobToPreparedParameter in class AbstractDictionary
public void characterToPreparedParameter(PreparedStatement st,
int index,
Character val)
throws SQLException
characterToPreparedParameter in class AbstractDictionarypublic Object dateToSQL(Date val)
DBDictionarydateToSQL in class AbstractDictionaryprotected void setupSQLTypeMap(SQLTypeMap map)
AbstractDictionarysetupSQLTypeMap in class AbstractDictionarypublic SQLBuffer[] getDropColumnSQL(Column column)
getDropColumnSQL in class AbstractDictionarypublic SQLBuffer[] getAddColumnSQL(Column column)
getAddColumnSQL in class AbstractDictionary
protected SQLBuffer getColumnDeclaration(Column column,
boolean ignorePK)
<column-name> <sql-type> [NOT NULL].
Where NOT NULL is appended if it is a primary key column.
public SQLBuffer toSelect(String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
AbstractDictionarytoSelect in class AbstractDictionarycom.solarmetric.kodo.impl.jdbc.schema.DBDictionarycols - list of values the columns to selecttables - list of the tables to select fromwhere - the WHERE conditions; may be null if noneorder - the ORDER BY conditions; may be null if nonedistinct - if true, this should be a SELECT DISTINCT-equivalent
queryupdate - if true this should be a SELECT FOR
UPDATE-equivalent query
public Object blobFromSQL(ResultSet rs,
int column)
throws SQLException
DBDictionaryblobFromSQL in class AbstractDictionary
public Date dateFromSQL(ResultSet rs,
int column)
throws SQLException
DBDictionarydateFromSQL in class AbstractDictionaryprotected int getDatePrecision()
AbstractDictionarygetDatePrecision in class AbstractDictionarypublic String getValidIndexName(String name)
getMaxIndexNameLength()-1 plus an 'I'
that is appended to the end of the given name to avoid SQL
keyword conflicts.getValidIndexName in class AbstractDictionary
public void booleanToPreparedParameter(PreparedStatement st,
int index,
Boolean val)
throws SQLException
booleanToPreparedParameter in class AbstractDictionarypublic boolean supportsAutoIncrement()
DBDictionarytrue if this dictionary / database
combination supports auto-incrementing primary-key columns.supportsAutoIncrement in class AbstractDictionary
public long getNextAutoIncrementValue(Table table,
SQLExecutionManager sqlem)
throws SQLException
DBDictionarygetNextAutoIncrementValue in class AbstractDictionaryprotected SQLBuffer getColumnDeclaration(Column column)
AbstractDictionary<column-name> <sql-type> [NOT NULL].
Where NOT NULL is appended if it is a primary key column.getColumnDeclaration in class AbstractDictionaryprotected String getAutoIncrementSequence(Column col)
col.
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||