|
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.SybaseDictionary
Implementation of DBDictionary for Sybase.
The main point of interest is that by default, every table
that is created will have a unique column named "UNQ_INDEX" of
the "IDENTITY" type. Kodo will not ever utilize this column. However,
due to internal Sybase restrictions, this column is required
in order to support pessimistic (datastore) locking, since Sybase
requires that any tables in a "SELECT ... FOR UPDATE" clause have
a unique index that is not included in the list
of columns, as described in the
Sybase documentation. This behavior can be surpressed by setting the
dictionary property CreateIdentityColumn=false. The
name of the unique column can be changed by setting the property
IdentityColumnName=COLUMN_NAME.
| Fields inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary |
CENTI, DECI, meta, MICRO, MILLI, NANO, NUMBER_FORMAT, SEC |
| Constructor Summary | |
SybaseDictionary()
|
|
| Method Summary | |
SQLBuffer |
addForUpdateClause(SQLBuffer buffer,
String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
Sybase requires that a "FOR UPDATE" clause include each of the column names as well as appending a "AT ISOLATION SERIALIZABLE" clause. |
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]. |
ResultSet |
getColumns(String tableName,
Connection conn)
Return a ResultSet with all the column names in the given table. |
boolean |
getCreateIdentityColumn()
If true, then whenever the schematool creates a
table, it will append an additional IDENTITY column to the
table's creation SQL. |
SQLBuffer[] |
getCreateTableSQL(Table table)
If getIdentityColumnName() is true, then we will add
in a unique identity column. |
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. |
protected SQLBuffer |
getDropIndexSQL(Index index)
Return the SQL to drop an index. |
String |
getIdentityColumnName()
If getCreateIdentityColumn() is true, then the
identityColumnName will be the name of the
additional unique column that will be created. |
String |
getPlatform()
Return the title of this database platform, used for display only. |
ResultSet |
getTables(Connection conn)
Return a ResultSet with all the tables in the database. |
void |
setCreateIdentityColumn(boolean createIdentityColumn)
If true, then whenever the schematool creates a
table, it will append an additional IDENTITY column to the
table's creation SQL. |
void |
setIdentityColumnName(String identityColumnName)
If getCreateIdentityColumn() is true, then the
identityColumnName will be the name of the
additional unique column that will be created. |
void |
setNullParameter(PreparedStatement st,
int index,
int type)
Since Sybase does not support Types.BLOB or
Types.CLOB, we override the setNull method
to Types.VARCHAR and Types.VARBINARY,
respectively. |
protected void |
setupSQLTypeMap(SQLTypeMap map)
This is the most commonly overridden method when porting to a new database. |
void |
validateConfiguration(JDBCConfiguration conf,
DBMetaData meta)
Raise a warning if the ConnectionURL does not have the special "SelectMethod=cursor" parameter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SybaseDictionary()
| Method Detail |
public String getPlatform()
AbstractDictionarygetPlatform in class AbstractDictionaryprotected void setupSQLTypeMap(SQLTypeMap map)
AbstractDictionarysetupSQLTypeMap in class AbstractDictionarypublic SQLBuffer[] getCreateTableSQL(Table table)
getIdentityColumnName() is true, then we will add
in a unique identity column.getCreateTableSQL 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 SQLBuffer getDropIndexSQL(Index index)
AbstractDictionaryDROP INDEX <index-name>getDropIndexSQL in class AbstractDictionarypublic SQLBuffer[] getDropColumnSQL(Column column)
DBDictionarygetDropColumnSQL in class AbstractDictionary
public SQLBuffer addForUpdateClause(SQLBuffer buffer,
String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
addForUpdateClause in class AbstractDictionary
public void setNullParameter(PreparedStatement st,
int index,
int type)
throws SQLException
Types.BLOB or
Types.CLOB, we override the setNull method
to Types.VARCHAR and Types.VARBINARY,
respectively.setNullParameter in class AbstractDictionarypublic void setCreateIdentityColumn(boolean createIdentityColumn)
schematool creates a
table, it will append an additional IDENTITY column to the
table's creation SQL. This is so Sybase will be able to
perform SELECT...FOR UPDATE statements.public boolean getCreateIdentityColumn()
schematool creates a
table, it will append an additional IDENTITY column to the
table's creation SQL. This is so Sybase will be able to
perform SELECT...FOR UPDATE statements.public void setIdentityColumnName(String identityColumnName)
getCreateIdentityColumn() is true, then the
identityColumnName will be the name of the
additional unique column that will be created.public String getIdentityColumnName()
getCreateIdentityColumn() is true, then the
identityColumnName will be the name of the
additional unique column that will be created.
public void validateConfiguration(JDBCConfiguration conf,
DBMetaData meta)
validateConfiguration in class AbstractDictionary
public ResultSet getTables(Connection conn)
throws SQLException
DBDictionarygetTables in class AbstractDictionary
public ResultSet getColumns(String tableName,
Connection conn)
throws SQLException
DBDictionaryDatabaseMetaData.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:
getColumns in class AbstractDictionary
|
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 | ||||||||