|
||||||||||
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.AbstractDB2Dictionary org.apache.openjpa.jdbc.sql.DB2Dictionary
public class DB2Dictionary
Dictionary for IBM DB2 database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary |
---|
DBDictionary.SerializedData |
Field Summary | |
---|---|
protected String |
databaseProductName
|
protected String |
databaseProductVersion
|
protected static int |
db2ISeriesV5R3OrEarlier
|
protected static int |
db2ISeriesV5R4OrLater
|
protected int |
db2ServerType
|
protected static int |
db2UDBV81OrEarlier
|
protected static int |
db2UDBV82OrLater
|
protected static int |
db2ZOSV8xOrLater
|
protected int |
maj
|
protected int |
min
|
String |
optimizeClause
|
String |
rowClause
|
Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes |
---|
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL |
Constructor Summary | |
---|---|
DB2Dictionary()
|
Method Summary | |
---|---|
String |
addCastAsType(String func,
Val val)
add CAST for a function operator where operand is a param |
protected void |
appendLength(SQLBuffer buf,
int type)
|
protected void |
appendSelectRange(SQLBuffer buf,
long start,
long end)
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)
If this dictionary supports XML type, use this method to append xml predicate. |
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 |
getCastFunction(Val val,
String func)
Return the correct CAST function syntax |
String[] |
getCreateSequenceSQL(Sequence seq)
Return a series of SQL statements to create the given sequence. |
int |
getDb2ServerType()
|
protected String |
getForUpdateClause(JDBCFetchConfiguration fetch,
boolean forUpdate)
Get the update clause for the query based on the updateClause and isolationLevel hints |
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 |
isDB2ISeriesV5R3OrEarlier()
|
boolean |
isDB2ISeriesV5R4OrLater()
|
boolean |
isDB2UDBV81OrEarlier()
|
boolean |
isDB2UDBV82OrLater()
|
boolean |
isDB2ZOSV8xOrLater()
|
OpenJPAException |
newStoreException(String msg,
SQLException[] causes,
Object failed)
Return a new exception that wraps causes . |
boolean |
supportsRandomAccessResultSet(Select sel,
boolean forUpdate)
Return false if the given select requires a forward-only result set. |
SQLBuffer |
toSelect(Select sel,
boolean forUpdate,
JDBCFetchConfiguration fetch)
Create a SELECT statement in the proper join syntax for the given instance. |
Methods inherited from class org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary |
---|
substring |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public String optimizeClause
public String rowClause
protected int db2ServerType
protected static final int db2ISeriesV5R3OrEarlier
protected static final int db2UDBV81OrEarlier
protected static final int db2ZOSV8xOrLater
protected static final int db2UDBV82OrLater
protected static final int db2ISeriesV5R4OrLater
protected String databaseProductName
protected String databaseProductVersion
protected int maj
protected int min
Constructor Detail |
---|
public DB2Dictionary()
Method Detail |
---|
public boolean supportsRandomAccessResultSet(Select sel, boolean forUpdate)
DBDictionary
supportsRandomAccessResultSet
in class DBDictionary
protected void appendSelectRange(SQLBuffer buf, long start, long end)
DBDictionary
appendSelectRange
in class DBDictionary
public String[] getCreateSequenceSQL(Sequence seq)
DBDictionary
CREATE SEQUENCE <sequence name>[ START WITH <start>]
[ INCREMENT BY <increment>]
by default.
getCreateSequenceSQL
in class DBDictionary
protected String getSequencesSQL(String schemaName, String sequenceName)
DBDictionary
getSequencesSQL
in class DBDictionary
public Connection decorate(Connection conn) throws SQLException
DBDictionary
DBDictionary.initializationSQL
that has been set for the dictionary but
does not decoreate the connection.
decorate
in interface ConnectionDecorator
decorate
in class DBDictionary
SQLException
public void connectedConfiguration(Connection conn) throws SQLException
DBDictionary
super.connectedConfiguration
.
connectedConfiguration
in class DBDictionary
SQLException
protected String getForUpdateClause(JDBCFetchConfiguration fetch, boolean forUpdate)
getForUpdateClause
in class DBDictionary
public boolean isDB2UDBV82OrLater() throws SQLException
SQLException
public boolean isDB2ZOSV8xOrLater() throws SQLException
SQLException
public boolean isDB2ISeriesV5R3OrEarlier() throws SQLException
SQLException
public boolean isDB2ISeriesV5R4OrLater() throws SQLException
SQLException
public boolean isDB2UDBV81OrEarlier() throws SQLException
SQLException
public SQLBuffer toSelect(Select sel, boolean forUpdate, JDBCFetchConfiguration fetch)
DBDictionary
toSelect
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
public int getDb2ServerType()
protected void appendLength(SQLBuffer buf, int type)
appendLength
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 String addCastAsType(String func, Val val)
addCastAsType
in class DBDictionary
func
- function nameval
- type
public String getCastFunction(Val val, String func)
getCastFunction
in class DBDictionary
val
- operand of castfunc
- original string
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
DBDictionary
indexOf
in class AbstractDB2Dictionary
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 beginning
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |