|
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 | ||||||||
Interface which allows the creation of SQL dynamically, in a database agnostic fashion.
| Method Summary | |
BigDecimal |
bigDecimalFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
bigDecimalToSQL(BigDecimal val)
Convert data into SQL for the current database platform. |
BigInteger |
bigIntegerFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
bigIntegerToSQL(BigInteger val)
Convert data into SQL for the current database platform. |
Object |
blobFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
blobToSQL(Object val)
Convert data into SQL for the current database platform. |
boolean |
booleanFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
booleanToSQL(boolean val)
Convert data into SQL for the current database platform. |
byte |
byteFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
byteToSQL(byte val)
Convert data into SQL for the current database platform. |
char |
charFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
charToSQL(char val)
Convert data into SQL for the current database platform. |
String |
clobFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
clobToSQL(Object val)
Convert data into SQL for the current database platform. |
void |
createdSQLExecutionManager(SQLExecutionManager manager)
Perform any necessary configuration of the newly created SQLExecutionManager. |
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. |
double |
doubleFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
doubleToSQL(double val)
Convert data into SQL for the current database platform. |
float |
floatFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
floatToSQL(float val)
Convert data into SQL for the current database platform. |
Object |
fromSQL(int type,
ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
SQLBuffer[] |
getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table, including the addition of any indexes on the column. |
ResultSet |
getColumns(String tableName,
Connection conn)
Return a ResultSet with all the column names in the given table. |
SQLBuffer[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, including any indexes it has. |
DBMetaData |
getDBMetaData()
Get the DBMetaData for this dictionary. |
SQLBuffer[] |
getDropColumnSQL(Column column)
Return a series of SQL statements to drop the given column from its table, including the deletion of any indices from the column. |
SQLBuffer[] |
getDropTableSQL(Table table)
Return a series of SQL statements to drop the given table, including any indexes it may have. |
Class[] |
getFieldMappingCandidateClasses()
Returns a list of possible FieldMapping
classes for use with this DBDictionary. |
long |
getNextAutoIncrementValue(Table table,
SQLExecutionManager sqlem)
Returns the next auto-increment value for a given table. |
String |
getNonSQL92LeftOuterJoin(String fromTableAlias,
Column[] fromCols,
String toTableAlias,
Column[] toCols)
Return the SQL to join the given columns together with a left outer join. |
String |
getPlatform()
Return the name of the platform for the DB type handled; for example, Oracle |
ResultSet |
getTables(Connection conn)
Return a ResultSet with all the tables in the database. |
String |
getValidColumnName(String name)
Make any necessary changes to the given column name to make it valid for the current DB. |
String |
getValidIndexName(String name)
Make any necessary changes to the given index name to make it valid for the current DB. |
String |
getValidTableName(String name)
Make any necessary changes to the given table name to make it valid for the current DB. |
int |
intFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
intToSQL(int val)
Convert data into SQL for the current database platform. |
boolean |
isClosed(Connection conn)
Some JDBC drivers do not validate the state of the Connection when Connection.isClosed()
is invoked. |
Locale |
localeFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
long |
longFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
longToSQL(long val)
Convert data into SQL for the current database platform. |
Object |
objectFromSQL(int type,
ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
objectToSQL(int type,
Object val)
Convert data into SQL for the current database platform. |
PreparedStatement |
prepareStatement(Connection conn,
SQLBuffer buffer,
SQLExecutionManager manager,
int type,
int concur)
Create a new PreparedStatement for the specified
Connection with the SQL in the SQLBuffer. |
void |
setColumnNameGenerator(NameGenerator generator)
Set the NameGenerator to use for generating column names. |
void |
setDBMetaData(DBMetaData meta)
Set the DBMetaData for this dictionary. |
void |
setIndexNameGenerator(NameGenerator generator)
Set the NameGenerator to use for generating index names. |
void |
setTableNameGenerator(NameGenerator generator)
Set the NameGenerator to use for generating table names. |
void |
setTransactionIsolation(Connection conn,
JDBCConfiguration config)
Setup the transaction isolation level on the Connection. |
short |
shortFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
shortToSQL(short val)
Convert data into SQL for the current database platform. |
String |
stringFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
stringToSQL(String val)
Convert data into SQL for the current database platform. |
boolean |
supportsAutoIncrement()
Returns true if this dictionary / database
combination supports auto-incrementing primary-key columns. |
boolean |
supportsLocking()
Returns whether or not this database supports locking (e.g., FOR UPDATE clause in SELECT). |
boolean |
supportsNonSQL92LeftOuterJoins()
Return true if this database supports a non-SQL92 style of left outer joins. |
boolean |
supportsUpdateCountsForBatch()
Returns true if the JDBC driver supports correct update counts in the return value from Statement.executeBatch(). |
void |
toPreparedParameter(int type,
PreparedStatement st,
int i,
Object val)
Set val as the i'th (base 1) element
in st. |
SQLBuffer |
toSelect(String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
Create a SELECT statement for this databse from the given parts. |
Object |
toSQL(int type,
Object obj)
Convert data into SQL for the current database platform. |
void |
validateConfiguration(JDBCConfiguration config,
DBMetaData meta)
Allow the dictionary to perform any validations of the configuration parameters. |
| Method Detail |
public DBMetaData getDBMetaData()
public void setDBMetaData(DBMetaData meta)
public boolean isClosed(Connection conn)
Connection when Connection.isClosed()
is invoked. This method will issue a small SQL
statement to validate that the Connection
is actually in a usable state.Connection is not validpublic String getPlatform()
public Object toSQL(int type,
Object obj)
SQLTypes.public Object booleanToSQL(boolean val)
public Object byteToSQL(byte val)
public Object charToSQL(char val)
public Object doubleToSQL(double val)
public Object floatToSQL(float val)
public Object intToSQL(int val)
public Object longToSQL(long val)
public Object shortToSQL(short val)
public Object bigDecimalToSQL(BigDecimal val)
public Object bigIntegerToSQL(BigInteger val)
public String stringToSQL(String val)
public Object dateToSQL(Date val)
public Object clobToSQL(Object val)
public Object blobToSQL(Object val)
public Object objectToSQL(int type,
Object val)
public Object fromSQL(int type,
ResultSet rs,
int column)
throws SQLException
SQLTypes.
public boolean booleanFromSQL(ResultSet rs,
int column)
throws SQLException
public byte byteFromSQL(ResultSet rs,
int column)
throws SQLException
public char charFromSQL(ResultSet rs,
int column)
throws SQLException
public double doubleFromSQL(ResultSet rs,
int column)
throws SQLException
public float floatFromSQL(ResultSet rs,
int column)
throws SQLException
public int intFromSQL(ResultSet rs,
int column)
throws SQLException
public long longFromSQL(ResultSet rs,
int column)
throws SQLException
public short shortFromSQL(ResultSet rs,
int column)
throws SQLException
public BigDecimal bigDecimalFromSQL(ResultSet rs,
int column)
throws SQLException
public BigInteger bigIntegerFromSQL(ResultSet rs,
int column)
throws SQLException
public String stringFromSQL(ResultSet rs,
int column)
throws SQLException
public Date dateFromSQL(ResultSet rs,
int column)
throws SQLException
public Locale localeFromSQL(ResultSet rs,
int column)
throws SQLException
public String clobFromSQL(ResultSet rs,
int column)
throws SQLException
public Object blobFromSQL(ResultSet rs,
int column)
throws SQLException
public Object objectFromSQL(int type,
ResultSet rs,
int column)
throws SQLException
public void toPreparedParameter(int type,
PreparedStatement st,
int i,
Object val)
throws SQLException
val as the i'th (base 1) element
in st. The given type will be from SQLTypes.public boolean supportsNonSQL92LeftOuterJoins()
public String getNonSQL92LeftOuterJoin(String fromTableAlias,
Column[] fromCols,
String toTableAlias,
Column[] toCols)
<table alias>.<column name>. This
method is only used for dictionaries that return true from
supportsNonSQL92LeftOuterJoins().
public SQLBuffer toSelect(String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
cols - 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 querypublic String getValidTableName(String name)
public String getValidColumnName(String name)
public String getValidIndexName(String name)
public SQLBuffer[] getCreateTableSQL(Table table)
public SQLBuffer[] getDropTableSQL(Table table)
public SQLBuffer[] getAddColumnSQL(Column column)
public SQLBuffer[] getDropColumnSQL(Column column)
public ResultSet getTables(Connection conn)
throws SQLException
public ResultSet getColumns(String tableName,
Connection conn)
throws SQLException
DatabaseMetaData.getColumns(String,String,String,String)
invocation, but the actual dictionary can choose to
implement this however they like, provided that
the ResultSet that is returned contains the following
columns:
public Class[] getFieldMappingCandidateClasses()
FieldMapping
classes for use with this DBDictionary.public boolean supportsLocking()
public void setIndexNameGenerator(NameGenerator generator)
NameGenerator to use for generating index names.public void setColumnNameGenerator(NameGenerator generator)
NameGenerator to use for generating column names.public void setTableNameGenerator(NameGenerator generator)
NameGenerator to use for generating table names.public boolean supportsUpdateCountsForBatch()
Statement.executeBatch().
public void setTransactionIsolation(Connection conn,
JDBCConfiguration config)
throws SQLException
JDBCConfiguration.getTransactionIsolationLevel(), but the
dictionary implementation retains the option of overriding
the default transaction level.public void createdSQLExecutionManager(SQLExecutionManager manager)
public boolean supportsAutoIncrement()
true if this dictionary / database
combination supports auto-incrementing primary-key columns.
public long getNextAutoIncrementValue(Table table,
SQLExecutionManager sqlem)
throws SQLException
public PreparedStatement prepareStatement(Connection conn,
SQLBuffer buffer,
SQLExecutionManager manager,
int type,
int concur)
throws SQLException
PreparedStatement for the specified
Connection with the SQL in the SQLBuffer.
public void validateConfiguration(JDBCConfiguration config,
DBMetaData meta)
|
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 | ||||||||