|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| 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 | |
|---|---|
Object |
blobFromSQL(ResultSet rs,
int column)
|
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)
|
Object |
dateToSQL(Date val)
|
SQLBuffer[] |
getAddColumnSQL(Column column)
PostgreSQL has special needs when altering PK columns. |
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. |
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 '. |
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 |
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)
dateToSQL 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
blobFromSQL in class AbstractDictionary
public Date dateFromSQL(ResultSet rs,
int column)
throws SQLException
dateFromSQL 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 AbstractDictionary
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||