|
||||||||||
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)
If this dictionary can select ranges, use this method to append the range SQL. |
java.lang.String[] |
getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table. |
java.lang.String[] |
getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to its table. |
Column[] |
getColumns(java.sql.DatabaseMetaData meta,
java.lang.String catalog,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
java.sql.Connection conn)
Reflect on the schema to find columns matching the given table and column patterns. |
java.lang.String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
java.lang.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. |
java.lang.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 java.lang.String |
getPrimaryKeyConstraintSQL(PrimaryKey pk)
Return the declaration SQL for the given primary key. |
protected java.lang.String |
getSequencesSQL(java.lang.String schemaName,
java.lang.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(java.lang.String name,
Table table)
This method is used to filter system indexes from database metadata. |
org.apache.openjpa.util.OpenJPAException |
newStoreException(java.lang.String msg,
java.sql.SQLException[] causes,
java.lang.Object failed)
Return a new exception that wraps causes . |
void |
setBigDecimal(java.sql.PreparedStatement stmnt,
int idx,
java.math.BigDecimal val,
Column col)
Set the given value as a parameter to the statement. |
void |
setLong(java.sql.PreparedStatement stmnt,
int idx,
long 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(java.lang.String op,
SQLBuffer selects,
SQLBuffer from,
SQLBuffer where,
SQLBuffer group,
SQLBuffer having,
SQLBuffer order,
boolean distinct,
boolean forUpdate,
long start,
long end)
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 java.lang.String[] getAddPrimaryKeySQL(PrimaryKey pk)
DBDictionary
ALTER TABLE <table name> ADD
<pk cons sql >
by default.
getAddPrimaryKeySQL
in class DBDictionary
public java.lang.String[] getDropPrimaryKeySQL(PrimaryKey pk)
DBDictionary
ALTER TABLE <table name> DROP CONSTRAINT
<pk name>
by default.
getDropPrimaryKeySQL
in class DBDictionary
public java.lang.String[] getAddColumnSQL(Column column)
DBDictionary
ALTER TABLE <table name> ADD (<col dec>)
by default.
getAddColumnSQL
in class DBDictionary
public java.lang.String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL
in class DBDictionary
protected java.lang.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(java.lang.String name, Table table)
DBDictionary
isSystemIndex
in class DBDictionary
name
- the index nametable
- the index tableprotected java.lang.String getSequencesSQL(java.lang.String schemaName, java.lang.String sequenceName)
DBDictionary
getSequencesSQL
in class DBDictionary
protected SQLBuffer toOperation(java.lang.String op, SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end)
DBDictionary
toOperation
in class DBDictionary
public Column[] getColumns(java.sql.DatabaseMetaData meta, java.lang.String catalog, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, java.sql.Connection conn) throws java.sql.SQLException
DBDictionary
getColumns
in class DBDictionary
java.sql.SQLException
public void setLong(java.sql.PreparedStatement stmnt, int idx, long val, Column col) throws java.sql.SQLException
DBDictionary
setLong
in class DBDictionary
java.sql.SQLException
public void setBigDecimal(java.sql.PreparedStatement stmnt, int idx, java.math.BigDecimal val, Column col) throws java.sql.SQLException
DBDictionary
setBigDecimal
in class DBDictionary
java.sql.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 java.lang.String getPlaceholderValueString(Column col)
DBDictionary
getPlaceholderValueString
in class DBDictionary
public org.apache.openjpa.util.OpenJPAException newStoreException(java.lang.String msg, java.sql.SQLException[] causes, java.lang.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 |