|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.jdbc.sql.DBDictionary
public class DBDictionary
Class which allows the creation of SQL dynamically, in a database agnostic fashion. Subclass for the nuances of different data stores.
| Nested Class Summary | |
|---|---|
static class |
DBDictionary.SerializedData
Used by some mappings to represent data that has already been serialized so that we don't have to serialize multiple times. |
| Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes |
|---|
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL |
| Constructor Summary | |
|---|---|
DBDictionary()
|
|
| Method Summary | |
|---|---|
String |
addCastAsType(String func,
Val val)
add CAST for a function operator where operand is a param |
void |
appendCast(SQLBuffer buf,
Object val,
int type)
Cast the specified value to the specified type. |
protected void |
appendLength(SQLBuffer buf,
int type)
|
protected void |
appendNumericCast(SQLBuffer buf,
FilterValue val)
Append SQL for the given numeric value to the buffer, casting as needed. |
protected void |
appendSelect(SQLBuffer selectSQL,
Object elem,
Select sel,
int idx)
Append elem to selectSQL. |
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. |
protected String |
appendSize(Column col,
String typeName)
Helper method to add size properties to the specified type. |
protected void |
appendUpdates(Select sel,
JDBCStore store,
SQLBuffer sql,
Object[] params,
Map updateParams,
boolean allowAlias)
|
void |
appendXmlComparison(SQLBuffer buf,
String op,
FilterValue lhs,
FilterValue rhs,
boolean lhsxml,
boolean rhsxml)
If this dictionary supports XML type, use this method to append xml predicate. |
void |
assertSupport(boolean feature,
String property)
Assert that the given dictionary flag is true. |
protected void |
calculateValue(Val val,
Select sel,
ExpContext ctx,
ExpState state,
Path path,
ExpState pathState)
This method is to provide override for non-JDBC or JDBC-like implementation of calculating value. |
boolean |
canOuterJoin(int syntax,
ForeignKey fk)
Returns if the given foreign key can be eagerly loaded using other joins. |
void |
closeDataSource(DataSource dataSource)
Closes the specified DataSource and releases any
resources associated with it. |
protected StringBuffer |
comment(StringBuffer buf,
String comment)
|
void |
comparison(SQLBuffer buf,
String op,
FilterValue lhs,
FilterValue rhs)
Append a comparison. |
void |
connectedConfiguration(Connection conn)
This method is called when the dictionary first sees any connection. |
protected String |
convertSchemaCase(String objectName)
Convert the specified schema name to a name that the database will be able to understand. |
protected long |
copy(InputStream in,
OutputStream out)
|
protected long |
copy(Reader reader,
Writer writer)
|
void |
createIndexIfNecessary(Schema schema,
String table,
Column pkColumn)
Create an index if necessary for some database tables |
Connection |
decorate(Connection conn)
Decorate the given connection if needed. |
void |
deleteStream(JDBCStore store,
Select sel)
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object. |
protected ResultSet |
executeQuery(Connection conn,
PreparedStatement stmnt,
String sql)
This method is to provide override for non-JDBC or JDBC-like implementation of executing query. |
String[] |
getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table. |
String[] |
getAddForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to add the given foreign key to its table. |
String[] |
getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to its table. |
Array |
getArray(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
InputStream |
getAsciiStream(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
int |
getBatchLimit()
Return the batchLimit |
BigDecimal |
getBigDecimal(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
BigInteger |
getBigInteger(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
InputStream |
getBinaryStream(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Blob |
getBlob(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
getBlobObject(ResultSet rs,
int column,
JDBCStore store)
Convert the specified column of the SQL ResultSet to the proper java type. |
boolean |
getBoolean(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
byte |
getByte(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
byte[] |
getBytes(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Calendar |
getCalendar(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getCastFunction(Val val,
String func)
Attach CAST to the current function if necessary |
protected String |
getCatalogNameForMetadata(String catalogName)
Returns the catalog name that will be used for obtaining information from DatabaseMetaData. |
char |
getChar(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Reader |
getCharacterStream(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Clob |
getClob(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getClobString(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
protected String |
getColumnNameForMetadata(String columnName)
Returns the column name that will be used for obtaining information from DatabaseMetaData. |
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[] |
getCreateIndexSQL(Index index)
Return a series of SQL statements to create the given index. |
String[] |
getCreateSequenceSQL(Sequence seq)
Return a series of SQL statements to create the given sequence. |
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
Date |
getDate(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Date |
getDate(ResultSet rs,
int column,
Calendar cal)
Convert the specified column of the SQL ResultSet to the proper java type. |
protected String |
getDeclareColumnSQL(Column col,
boolean alter)
Return the declaration SQL for the given column. |
String[] |
getDeleteTableContentsSQL(Table[] tables)
Create SQL to delete the contents of the specified tables. |
protected SQLBuffer |
getDeleteTargets(Select sel)
|