|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.adapter.AbstractAdapter org.apache.torque.adapter.OracleAdapter
public class OracleAdapter
This code should be used for an Oracle database pool.
Field Summary |
---|
Fields inherited from interface org.apache.torque.adapter.Adapter |
---|
ADAPTER_KEY, AUTODETECT_ADAPTER, DRIVER_KEY |
Constructor Summary | |
---|---|
protected |
OracleAdapter()
Empty constructor. |
Method Summary | |
---|---|
boolean |
escapeText()
This method is for the SqlExpression.quoteAndEscape rules. |
void |
generateLimits(Query query,
long offset,
int limit)
Build Oracle-style query with limit or offset. |
String |
getIDMethodSQL(Object sequenceName)
Returns the next key from a sequence. |
IDMethod |
getIDMethodType()
Returns the constant from the IDMethod interface denoting which
type of primary key generation method this type of RDBMS uses. |
String |
ignoreCase(String in)
This method is used to ignore case. |
void |
lockTable(Connection con,
String table)
Locks the specified table. |
boolean |
supportsNativeLimit()
Return true for Oracle |
boolean |
supportsNativeOffset()
Return true for Oracle |
String |
toUpperCase(String in)
This method is used to ignore case. |
void |
unlockTable(Connection con,
String table)
Unlocks the specified table. |
boolean |
useEscapeClauseForLike()
Whether an escape clause in like should be used. |
Methods inherited from class org.apache.torque.adapter.AbstractAdapter |
---|
getStringDelimiter, ignoreCaseInOrderBy, toTorqueException, useIlike |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected OracleAdapter()
Method Detail |
---|
public String toUpperCase(String in)
toUpperCase
in interface Adapter
toUpperCase
in class AbstractAdapter
in
- The string to transform to upper case.
public String ignoreCase(String in)
ignoreCase
in interface Adapter
ignoreCase
in class AbstractAdapter
in
- The string whose case to ignore.
public IDMethod getIDMethodType()
AbstractAdapter
IDMethod
interface denoting which
type of primary key generation method this type of RDBMS uses.
getIDMethodType
in interface Adapter
getIDMethodType
in class AbstractAdapter
Adapter.getIDMethodType()
public String getIDMethodSQL(Object sequenceName)
select sequenceName.nextval from dual
getIDMethodSQL
in interface Adapter
getIDMethodSQL
in class AbstractAdapter
sequenceName
- The name of the sequence (should be of type
String
).
Adapter.getIDMethodSQL(Object)
public void lockTable(Connection con, String table) throws SQLException
lockTable
in interface Adapter
lockTable
in class AbstractAdapter
con
- The JDBC connection to use.table
- The name of the table to lock.
SQLException
- No Statement could be created or executed.public void unlockTable(Connection con, String table) throws SQLException
unlockTable
in interface Adapter
unlockTable
in class AbstractAdapter
con
- The JDBC connection to use.table
- The name of the table to unlock.
SQLException
- No Statement could be created or executed.public boolean supportsNativeLimit()
supportsNativeLimit
in interface Adapter
supportsNativeLimit
in class AbstractAdapter
AbstractAdapter.supportsNativeLimit()
public boolean supportsNativeOffset()
supportsNativeOffset
in interface Adapter
supportsNativeOffset
in class AbstractAdapter
AbstractAdapter.supportsNativeOffset()
public void generateLimits(Query query, long offset, int limit)
SELECT B.* FROM ( SELECT A.*, rownum as TORQUE$ROWNUM FROM ( query ) A ) B WHERE B.TORQUE$ROWNUM > offset AND B.TORQUE$ROWNUM <= offset + limit
generateLimits
in interface Adapter
generateLimits
in class AbstractAdapter
query
- The query to modifyoffset
- the offset Valuelimit
- the limit Valuepublic boolean escapeText()
escapeText
in interface Adapter
escapeText
in class AbstractAdapter
public boolean useEscapeClauseForLike()
true
.
useEscapeClauseForLike
in interface Adapter
useEscapeClauseForLike
in class AbstractAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |