|
||||||||||
| 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.HSQLDictionary
public class HSQLDictionary
Dictionary for Hypersonic SQL database.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
|---|
DBDictionary.SerializedData |
| Field Summary | |
|---|---|
boolean |
cacheTables
Sets whether HSQL should use "CREATED CACHED TABLE" rather than "CREATE TABLE", which allows disk-based database operations. |
| Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes |
|---|
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL |
| Constructor Summary | |
|---|---|
HSQLDictionary()
|
|
| 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,
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. |
String |
getPlaceholderValueString(Column col)
Return a SQL string to act as a placeholder for the given column. |
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(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 |
isSystemIndex(String name,
Table table)
This method is used to filter system indexes from database metadata. |
OpenJPAException |
newStoreException(String msg,
SQLException[] causes,
Object failed)
Return a new exception that wraps causes. |
void |
setBigDecimal(PreparedStatement stmnt,
int idx,
BigDecimal val,
Column col)
Set the given value as a parameter to the statement. |
void |
setDouble(PreparedStatement stmnt,
int idx,
double val,
Column col)
Set the given value as a parameter to the statement. |
SQLBuffer |
toOperation(String op,
SQLBuffer selects,
SQLBuffer from,
SQLBuffer where,
SQLBuffer group,
SQLBuffer having,
SQLBuffer order,
boolean distinct,
long start,
long end,
String forUpdateClause)
Return the SQL for the given selecting operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean cacheTables
| Constructor Detail |
|---|
public HSQLDictionary()
| Method Detail |
|---|
public int getJDBCType(int metaTypeCode,
boolean lob)
DBDictionaryTypes constant for the given
JavaTypes or JavaSQLTypes constant.
getJDBCType in class DBDictionarypublic int getPreferredType(int type)
DBDictionaryTypes type for the given one. Returns
the given type by default.
getPreferredType in class DBDictionarypublic String[] getAddPrimaryKeySQL(PrimaryKey pk)
DBDictionaryALTER TABLE <table name> ADD
<pk cons sql > by default.
getAddPrimaryKeySQL in class DBDictionarypublic String[] getDropPrimaryKeySQL(PrimaryKey pk)
DBDictionaryALTER TABLE <table name> DROP CONSTRAINT
<pk name> by default.
getDropPrimaryKeySQL in class DBDictionarypublic String[] getAddColumnSQL(Column column)
DBDictionaryALTER TABLE <table name> ADD (<col dec>)
by default.
getAddColumnSQL in class DBDictionarypublic String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL in class DBDictionaryprotected String getPrimaryKeyConstraintSQL(PrimaryKey pk)
DBDictionaryDBDictionary.getCreateTableSQL(org.apache.openjpa.jdbc.schema.Table) 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 DBDictionaryname - the index nametable - the index table
protected String getSequencesSQL(String schemaName,
String sequenceName)
DBDictionary
getSequencesSQL in class DBDictionary
public SQLBuffer toOperation(String op,
SQLBuffer selects,
SQLBuffer from,
SQLBuffer where,
SQLBuffer group,
SQLBuffer having,
SQLBuffer order,
boolean distinct,
long start,
long end,
String forUpdateClause)
DBDictionary
toOperation in class DBDictionary
public Column[] getColumns(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
String columnName,
Connection conn)
throws SQLException
DBDictionary
getColumns in class DBDictionarySQLException
public void setDouble(PreparedStatement stmnt,
int idx,
double val,
Column col)
throws SQLException
DBDictionary
setDouble in class DBDictionarySQLException
public void setBigDecimal(PreparedStatement stmnt,
int idx,
BigDecimal val,
Column col)
throws SQLException
DBDictionary
setBigDecimal in class DBDictionarySQLException
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 DBDictionarybuf - 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 String getPlaceholderValueString(Column col)
DBDictionary
getPlaceholderValueString in class DBDictionary
public OpenJPAException newStoreException(String msg,
SQLException[] causes,
Object failed)
DBDictionarycauses.
However, the details of exactly what type of exception is returned can
be determined by the implementation. This may take into account
DB-specific exception information in causes.
newStoreException in class DBDictionary
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||