SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

com.solarmetric.kodo.impl.jdbc.schema
Interface DBDictionary

All Known Implementing Classes:
GenericDictionary

public interface DBDictionary

Interface which allows the creation of SQL dynamically, in a database agnostic fashion.

Author:
Stephen Kim, Abe White

Method Summary
 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.
 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.
 String[] 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.
 Class[] getClassMappingCandidateClasses()
          Returns a list of possible ClassMapping classes for use with this DBDictionary.
 ResultSet getColumns(String tableName, Connection conn)
          Return a ResultSet with all the column names in the given table.
 String[] 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.
 String[] 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.
 String[] 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.
 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.
 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.
 void setDBMetaData(DBMetaData meta)
          Set the DBMetaData for this dictionary.
 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.
 void toPreparedParameter(int type, PreparedStatement st, int i, Object val)
          Set val as the i'th (base 1) element in st.
 String toSelect(String[] cols, String[] tables, String where, String 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.
 

Method Detail

getDBMetaData

public DBMetaData getDBMetaData()
Get the DBMetaData for this dictionary.

setDBMetaData

public void setDBMetaData(DBMetaData meta)
Set the DBMetaData for this dictionary.

getPlatform

public String getPlatform()
Return the name of the platform for the DB type handled; for example, Oracle

toSQL

public Object toSQL(int type,
                    Object obj)
Convert data into SQL for the current database platform. The given type constant will be from the constants of SQLTypes.

booleanToSQL

public Object booleanToSQL(boolean val)
Convert data into SQL for the current database platform.

byteToSQL

public Object byteToSQL(byte val)
Convert data into SQL for the current database platform.

charToSQL

public Object charToSQL(char val)
Convert data into SQL for the current database platform.

doubleToSQL

public Object doubleToSQL(double val)
Convert data into SQL for the current database platform.

floatToSQL

public Object floatToSQL(float val)
Convert data into SQL for the current database platform.

intToSQL

public Object intToSQL(int val)
Convert data into SQL for the current database platform.

longToSQL

public Object longToSQL(long val)
Convert data into SQL for the current database platform.

shortToSQL

public Object shortToSQL(short val)
Convert data into SQL for the current database platform.

fromSQL

public Object fromSQL(int type,
                      ResultSet rs,
                      int column)
               throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type. The type will be from the constants of SQLTypes.

booleanFromSQL

public boolean booleanFromSQL(ResultSet rs,
                              int column)
                       throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

byteFromSQL

public byte byteFromSQL(ResultSet rs,
                        int column)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

charFromSQL

public char charFromSQL(ResultSet rs,
                        int column)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

doubleFromSQL

public double doubleFromSQL(ResultSet rs,
                            int column)
                     throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

floatFromSQL

public float floatFromSQL(ResultSet rs,
                          int column)
                   throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

intFromSQL

public int intFromSQL(ResultSet rs,
                      int column)
               throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

longFromSQL

public long longFromSQL(ResultSet rs,
                        int column)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

shortFromSQL

public short shortFromSQL(ResultSet rs,
                          int column)
                   throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

toPreparedParameter

public void toPreparedParameter(int type,
                                PreparedStatement st,
                                int i,
                                Object val)
                         throws SQLException
Set val as the i'th (base 1) element in st. The given type will be from SQLTypes.

toSelect

public String toSelect(String[] cols,
                       String[] tables,
                       String where,
                       String order,
                       boolean distinct,
                       boolean update)
Create a SELECT statement for this databse from the given parts. Many databases use alternate syntaxes for complex queries; this method can be used to create a query from its basic parts.
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

getValidTableName

public String getValidTableName(String name)
Make any necessary changes to the given table name to make it valid for the current DB.

getValidColumnName

public String getValidColumnName(String name)
Make any necessary changes to the given column name to make it valid for the current DB.

getValidIndexName

public String getValidIndexName(String name)
Make any necessary changes to the given index name to make it valid for the current DB.

getCreateTableSQL

public String[] getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, including any indexes it has.

getDropTableSQL

public String[] getDropTableSQL(Table table)
Return a series of SQL statements to drop the given table, including any indexes it may have.

getAddColumnSQL

public String[] 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.

getDropColumnSQL

public String[] 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.

getTables

public ResultSet getTables(Connection conn)
                    throws SQLException
Return a ResultSet with all the tables in the database. Used when determining what tables need to be updated during schema manipulation.

getColumns

public ResultSet getColumns(String tableName,
                            Connection conn)
                     throws SQLException
Return a ResultSet with all the column names in the given table. Used when determining what tables need to be updated during schema manipulation.

getClassMappingCandidateClasses

public Class[] getClassMappingCandidateClasses()
Returns a list of possible ClassMapping classes for use with this DBDictionary.

getFieldMappingCandidateClasses

public Class[] getFieldMappingCandidateClasses()
Returns a list of possible FieldMapping classes for use with this DBDictionary.

SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

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