|
||||||||||
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.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)
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. |
void |
substring(SQLBuffer buf,
FilterValue str,
FilterValue start,
FilterValue end)
Invoke this database's substring function. |
protected 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)
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)
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 tableprotected String getSequencesSQL(String schemaName, String sequenceName)
DBDictionary
getSequencesSQL
in class DBDictionary
protected 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 DBDictionary
SQLException
public void setDouble(PreparedStatement stmnt, int idx, double val, Column col) throws SQLException
DBDictionary
setDouble
in class DBDictionary
SQLException
public void setBigDecimal(PreparedStatement stmnt, int idx, BigDecimal val, Column col) throws SQLException
DBDictionary
setBigDecimal
in class DBDictionary
SQLException
protected void appendSelectRange(SQLBuffer buf, long start, long end)
DBDictionary
appendSelectRange
in class DBDictionary
public void substring(SQLBuffer buf, FilterValue str, FilterValue start, FilterValue end)
DBDictionary
substring
in class DBDictionary
buf
- the SQL buffer to write the substring invocation tostr
- a query value representing the target stringstart
- a query value representing the start indexend
- a query value representing the end index, or null for nonepublic 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 String getPlaceholderValueString(Column col)
DBDictionary
getPlaceholderValueString
in class DBDictionary
public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed)
DBDictionary
causes
.
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 |