|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.jdbc.sql.DBDictionary
org.apache.openjpa.jdbc.sql.AbstractSQLServerDictionary
org.apache.openjpa.jdbc.sql.SybaseDictionary
public class SybaseDictionary
Dictionary 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. OpenJPA 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.
A good Sybase type reference is can be found here.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
|---|
DBDictionary.SerializedData |
| Field Summary | |
|---|---|
boolean |
createIdentityColumn
If true, then whenever the schematool creates a
table, it will append an additional IDENTITY column to the
table's creation SQL. |
java.lang.String |
identityColumnName
If createIdentityColumn is true, then the
identityColumnName will be the name of the
additional unique column that will be created. |
| Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes |
|---|
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL |
| Constructor Summary | |
|---|---|
SybaseDictionary()
|
|
| Method Summary | |
|---|---|
java.sql.Connection |
decorate(java.sql.Connection conn)
Decorate the given connection if needed. |
void |
endConfiguration()
|
java.lang.String[] |
getAddForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to add the given foreign key to its table. |
java.lang.String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
protected java.lang.String |
getDeclareColumnSQL(Column col,
boolean alter)
Return the declaration SQL for the given column. |
java.lang.String[] |
getDropColumnSQL(Column column)
Return a series of SQL statements to drop the given column from its table. |
int |
getJDBCType(int metaTypeCode,
boolean lob)
Return the preferred Types constant for the given
JavaTypes or JavaSQLTypes constant. |
void |
refSchemaComponents(Table table)
Increment the reference count of any table components that this dictionary adds that are not used by mappings. |
void |
setBigInteger(java.sql.PreparedStatement stmnt,
int idx,
java.math.BigInteger val,
Column col)
Set the given value as a parameter to the statement. |
| Methods inherited from class org.apache.openjpa.jdbc.sql.AbstractSQLServerDictionary |
|---|
appendSelectRange, getColumns, getFullName, indexOf, setNull, substring |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public 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 java.lang.String identityColumnName
createIdentityColumn is true, then the
identityColumnName will be the name of the
additional unique column that will be created.
| Constructor Detail |
|---|
public SybaseDictionary()
| Method Detail |
|---|
public int getJDBCType(int metaTypeCode,
boolean lob)
DBDictionaryTypes constant for the given
JavaTypes or JavaSQLTypes constant.
getJDBCType in class DBDictionary
public void setBigInteger(java.sql.PreparedStatement stmnt,
int idx,
java.math.BigInteger val,
Column col)
throws java.sql.SQLException
DBDictionary
setBigInteger in class DBDictionaryjava.sql.SQLExceptionpublic java.lang.String[] getAddForeignKeySQL(ForeignKey fk)
DBDictionaryALTER TABLE <table name> ADD
<fk cons sql > by default.
getAddForeignKeySQL in class DBDictionarypublic java.lang.String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL in class DBDictionary
protected java.lang.String getDeclareColumnSQL(Column col,
boolean alter)
DBDictionaryDBDictionary.getCreateTableSQL(org.apache.openjpa.jdbc.schema.Table) and
DBDictionary.getAddColumnSQL(org.apache.openjpa.jdbc.schema.Column).
getDeclareColumnSQL in class DBDictionarypublic java.lang.String[] getDropColumnSQL(Column column)
DBDictionaryALTER TABLE <table name> DROP COLUMN <col name>
by default.
getDropColumnSQL in class DBDictionarypublic void refSchemaComponents(Table table)
DBDictionary
refSchemaComponents in class DBDictionarypublic void endConfiguration()
endConfiguration in interface ConfigurableendConfiguration in class DBDictionary
public java.sql.Connection decorate(java.sql.Connection conn)
throws java.sql.SQLException
DBDictionaryDBDictionary.initializationSQL that has been set for the dictionary but
does not decorate the connection.
decorate in interface ConnectionDecoratordecorate in class DBDictionaryjava.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||