|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.jdbc.sql.DBDictionary org.apache.openjpa.jdbc.sql.H2Dictionary
public class H2Dictionary
Dictionary for H2 (http://www.h2database.com
).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
---|
DBDictionary.SerializedData |
Field Summary |
---|
Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes |
---|
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL |
Constructor Summary | |
---|---|
H2Dictionary()
|
Method Summary | |
---|---|
protected void |
appendSelectRange(SQLBuffer buf,
long start,
long end,
boolean subselect)
If this dictionary can select ranges, use this method to append the range SQL. |
String[] |
getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table. |
String[] |
getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to its table. |
Column[] |
getColumns(DatabaseMetaData meta,
DBIdentifier catalog,
DBIdentifier schemaName,
DBIdentifier tableName,
DBIdentifier columnName,
Connection conn)
Reflect on the schema to find columns matching the given table and column patterns. |
Column[] |
getColumns(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
String columnName,
Connection conn)
Reflect on the schema to find columns matching the given table and column patterns. |
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
String[] |
getDropPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to drop the given primary key from its table. |
int |
getJDBCType(int metaTypeCode,
boolean lob)
Return the preferred Types constant for the given
JavaTypes or JavaSQLTypes constant. |
int |
getPreferredType(int type)
Return the preferred Types type for the given one. |
protected String |
getPrimaryKeyConstraintSQL(PrimaryKey pk)
Return the declaration SQL for the given primary key. |
protected String |
getSequencesSQL(DBIdentifier schemaName,
DBIdentifier sequenceName)
|
protected String |
getSequencesSQL(String schemaName,
String sequenceName)
Return the SQL needed to select the list of sequences. |
void |
indexOf(SQLBuffer buf,
FilterValue str,
FilterValue find,
FilterValue start)
Invoke this database's indexOf function. |
boolean |
isFatalException(int subtype,
SQLException ex)
Determine if the given SQL Exception is fatal or recoverable (such as a timeout). |
boolean |
isSystemIndex(DBIdentifier name,
Table table)
This method is used to filter system indexes from database metadata. |
boolean |
isSystemIndex(String name,
Table table)
This method is used to filter system indexes from database metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public H2Dictionary()
Method Detail |
---|
public int getJDBCType(int metaTypeCode, boolean lob)
DBDictionary
Types
constant for the given
JavaTypes
or JavaSQLTypes
constant.
getJDBCType
in class DBDictionary
public int getPreferredType(int type)
DBDictionary
Types
type for the given one. Returns
the given type by default.
getPreferredType
in class DBDictionary
public String[] getAddPrimaryKeySQL(PrimaryKey pk)
DBDictionary
ALTER TABLE <table name> ADD
<pk cons sql >
by default.
getAddPrimaryKeySQL
in class DBDictionary
public String[] getDropPrimaryKeySQL(PrimaryKey pk)
DBDictionary
ALTER TABLE <table name> DROP CONSTRAINT
<pk name>
by default.
getDropPrimaryKeySQL
in class DBDictionary
public String[] getAddColumnSQL(Column column)
DBDictionary
ALTER TABLE <table name> ADD (<col dec>)
by default.
getAddColumnSQL
in class DBDictionary
public String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL
in class DBDictionary
protected String getPrimaryKeyConstraintSQL(PrimaryKey pk)
DBDictionary
DBDictionary.getCreateTableSQL(org.apache.openjpa.jdbc.schema.Table, org.apache.openjpa.jdbc.schema.SchemaGroup)
and
DBDictionary.getAddPrimaryKeySQL(org.apache.openjpa.jdbc.schema.PrimaryKey)
. Returns
CONSTRAINT <pk name> PRIMARY KEY (<col list>)
by default.
getPrimaryKeyConstraintSQL
in class DBDictionary
public boolean isSystemIndex(String name, Table table)
DBDictionary
isSystemIndex
in class DBDictionary
name
- the index nametable
- the index tablepublic boolean isSystemIndex(DBIdentifier name, Table table)
DBDictionary
isSystemIndex
in class DBDictionary
name
- the index nametable
- the index tableprotected String getSequencesSQL(String schemaName, String sequenceName)
DBDictionary
getSequencesSQL
in class DBDictionary
protected String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
getSequencesSQL
in class DBDictionary
public Column[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) throws SQLException
DBDictionary
getColumns
in class DBDictionary
SQLException
public Column[] getColumns(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, DBIdentifier columnName, Connection conn) throws SQLException
DBDictionary
getColumns
in class DBDictionary
SQLException
protected void appendSelectRange(SQLBuffer buf, long start, long end, boolean subselect)
DBDictionary
appendSelectRange
in class DBDictionary
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
DBDictionary
indexOf
in class DBDictionary
buf
- the SQL buffer to write the indexOf invocation tostr
- a query value representing the target stringfind
- a query value representing the search stringstart
- a query value representing the start index, or null
to start at the beginningpublic boolean isFatalException(int subtype, SQLException ex)
DBDictionary
isFatalException
in class DBDictionary
subtype
- A constant indicating the category of error as defined in StoreException
.ex
- original SQL Exception as raised by the database driver.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |