|
||||||||||
| 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. |
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 | |
|---|---|
Connection |
decorate(Connection conn)
Decorate the given connection if needed. |
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object. |
String[] |
getAddForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to add the given foreign key to its table. |
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
protected String |
getDeclareColumnSQL(Column col,
boolean alter)
Return the declaration SQL for the given column. |
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. |
protected Index |
newIndex(ResultSet idxMeta)
Create a new index from the information in the index metadata. |
protected PrimaryKey |
newPrimaryKey(ResultSet pkMeta)
Create a new primary key from the information in the schema metadata. |
void |
refSchemaComponents(Table table)
Increment the reference count of any table components that this dictionary adds that are not used by mappings. |
void |
setBigInteger(PreparedStatement stmnt,
int idx,
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 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(PreparedStatement stmnt,
int idx,
BigInteger val,
Column col)
throws SQLException
DBDictionary
setBigInteger in class DBDictionarySQLExceptionpublic String[] getAddForeignKeySQL(ForeignKey fk)
DBDictionaryALTER TABLE <table name> ADD
<fk cons sql > by default.
getAddForeignKeySQL in class DBDictionarypublic String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL in class DBDictionary
protected 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 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()
Configurable
endConfiguration in interface ConfigurableendConfiguration in class DBDictionary
public Connection decorate(Connection conn)
throws SQLException
DBDictionaryDBDictionary.initializationSQL that has been set for the dictionary but
does not decorate the connection.
decorate in interface ConnectionDecoratordecorate in class DBDictionarySQLException
protected PrimaryKey newPrimaryKey(ResultSet pkMeta)
throws SQLException
newPrimaryKey in class DBDictionarySQLException
protected Index newIndex(ResultSet idxMeta)
throws SQLException
newIndex in class DBDictionarySQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||