|
||||||||||
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.MySQLDictionary
public class MySQLDictionary
Dictionary for MySQL.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
---|
DBDictionary.DBIdentifiers, DBDictionary.SerializedData |
Field Summary | |
---|---|
boolean |
driverDeserializesBlobs
Whether the driver automatically deserializes blobs. |
boolean |
optimizeMultiTableDeletes
Whether to inline multi-table bulk-delete operations into MySQL's combined DELETE FROM foo, bar, baz syntax. |
static String |
SELECT_HINT
|
String |
tableType
The MySQL table type to use when creating tables; defaults to innodb. |
boolean |
useClobs
Whether to use clobs; defaults to true. |
Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes |
---|
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL |
Constructor Summary | |
---|---|
MySQLDictionary()
|
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. |
void |
appendXmlComparison(SQLBuffer buf,
String op,
FilterValue lhs,
FilterValue rhs,
boolean lhsxml,
boolean rhsxml)
Append XML comparison. |
void |
connectedConfiguration(Connection conn)
This method is called when the dictionary first sees any connection. |
Connection |
decorate(Connection conn)
Decorate the given connection if needed. |
String[] |
getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to its table. |
int |
getBatchFetchSize(int batchFetchSize)
|
Object |
getBlobObject(ResultSet rs,
int column,
JDBCStore store)
Convert the specified column of the SQL ResultSet to the proper java type. |
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
String[] |
getDeleteTableContentsSQL(Table[] tables,
Connection conn)
Create SQL to delete the contents of the specified tables. |
String[] |
getDropForeignKeySQL(ForeignKey fk,
Connection conn)
Return ALTER TABLE <table name> DROP FOREIGN KEY
<fk name> . |
String[] |
getDropIndexSQL(Index index)
Return a series of SQL statements to drop the given index. |
String[] |
getDropPrimaryKeySQL(PrimaryKey pk)
Return ALTER TABLE <table name> DROP PRIMARY KEY . |
int |
getPreferredType(int type)
Return the preferred Types type for the given one. |
String |
getSelectOperation(JDBCFetchConfiguration fetch)
Check to see if we have set the SELECT_HINT in the
fetch configuration, and if so, append the MySQL hint after the
"SELECT" part of the query. |
protected Column |
newColumn(ResultSet colMeta)
Create a new column from the information in the schema metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SELECT_HINT
public String tableType
public boolean useClobs
public boolean driverDeserializesBlobs
public boolean optimizeMultiTableDeletes
DELETE FROM foo, bar, baz
syntax.
Defaults to false, since this may fail in the presence of InnoDB tables
with foreign keys.
http://dev.mysql.com/doc/refman/5.0/en/delete.html
Constructor Detail |
---|
public MySQLDictionary()
Method Detail |
---|
public void connectedConfiguration(Connection conn) throws SQLException
DBDictionary
super.connectedConfiguration
.
connectedConfiguration
in class DBDictionary
SQLException
public Connection decorate(Connection conn) throws SQLException
DBDictionary
DBDictionary.initializationSQL
that has been set for the dictionary but
does not decorate the connection.
decorate
in interface ConnectionDecorator
decorate
in class DBDictionary
SQLException
public String[] getCreateTableSQL(Table table)
DBDictionary
getCreateTableSQL
in class DBDictionary
public String[] getDropIndexSQL(Index index)
DBDictionary
DROP INDEX <index name>
by default.
getDropIndexSQL
in class DBDictionary
public String[] getDropPrimaryKeySQL(PrimaryKey pk)
ALTER TABLE <table name> DROP PRIMARY KEY
.
getDropPrimaryKeySQL
in class DBDictionary
public String[] getDropForeignKeySQL(ForeignKey fk, Connection conn)
ALTER TABLE <table name> DROP FOREIGN KEY
<fk name>
.
getDropForeignKeySQL
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[] getDeleteTableContentsSQL(Table[] tables, Connection conn)
DBDictionary
getDeleteTableContentsSQL
in class DBDictionary
protected void appendSelectRange(SQLBuffer buf, long start, long end, boolean subselect)
DBDictionary
appendSelectRange
in class DBDictionary
protected Column newColumn(ResultSet colMeta) throws SQLException
DBDictionary
newColumn
in class DBDictionary
SQLException
public Object getBlobObject(ResultSet rs, int column, JDBCStore store) throws SQLException
DBDictionary
getBlobObject
in class DBDictionary
SQLException
public int getPreferredType(int type)
DBDictionary
Types
type for the given one. Returns
the given type by default.
getPreferredType
in class DBDictionary
public void appendXmlComparison(SQLBuffer buf, String op, FilterValue lhs, FilterValue rhs, boolean lhsxml, boolean rhsxml)
appendXmlComparison
in class DBDictionary
buf
- the SQL buffer to write the comparisonop
- the comparison operation to performlhs
- the left hand side of the comparisonrhs
- the right hand side of the comparisonlhsxml
- indicates whether the left operand maps to XMLrhsxml
- indicates whether the right operand maps to XMLpublic int getBatchFetchSize(int batchFetchSize)
getBatchFetchSize
in class DBDictionary
public String getSelectOperation(JDBCFetchConfiguration fetch)
SELECT_HINT
in the
fetch configuration, and if so, append the MySQL hint after the
"SELECT" part of the query.
getSelectOperation
in class DBDictionary
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |