|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.adapter.AbstractAdapter
org.apache.torque.adapter.DerbyAdapter
public class DerbyAdapter
This is used to connect to an embedded Apache Derby Database using the supplied JDBC driver.
Field Summary |
---|
Fields inherited from interface org.apache.torque.adapter.Adapter |
---|
ADAPTER_KEY, AUTODETECT_ADAPTER, DRIVER_KEY |
Constructor Summary | |
---|---|
protected |
DerbyAdapter()
Empty constructor. |
Method Summary | |
---|---|
boolean |
escapeText()
Whether backslashes (\) should be escaped in explicit SQL strings. |
void |
generateLimits(Query query,
long offset,
int limit)
Build Derby-style query with limit or offset. |
String |
getIDMethodSQL(Object obj)
Returns the SQL to get the database key of the last row inserted, which in this case is VALUES IDENTITY_VAL_LOCAL() . |
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 str)
This method is used to ignore case. |
void |
lockTable(Connection con,
String table)
Locks the specified table. |
boolean |
supportsNativeLimit()
Returns whether the database can natively limit the size of the ResultSet of a query. |
boolean |
supportsNativeOffset()
Returns whether the database natively supports returning results starting at an offset position other than 0. |
String |
toUpperCase(String str)
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, getUpdateLockClause, ignoreCaseInOrderBy, useIlike |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DerbyAdapter()
Method Detail |
---|
public String toUpperCase(String str)
toUpperCase
in interface Adapter
toUpperCase
in class AbstractAdapter
str
- The string to transform to upper case.
public String ignoreCase(String str)
ignoreCase
in interface Adapter
ignoreCase
in class AbstractAdapter
str
- 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 obj)
VALUES IDENTITY_VAL_LOCAL()
.
getIDMethodSQL
in interface Adapter
getIDMethodSQL
in class AbstractAdapter
obj
- Information used for key generation.
Adapter.getIDMethodSQL(Object obj)
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 escapeText()
escapeText
in interface Adapter
escapeText
in class AbstractAdapter
public boolean useEscapeClauseForLike()
true
.
useEscapeClauseForLike
in interface Adapter
useEscapeClauseForLike
in class AbstractAdapter
public boolean supportsNativeLimit()
supportsNativeLimit
in interface Adapter
supportsNativeLimit
in class AbstractAdapter
public boolean supportsNativeOffset()
supportsNativeOffset
in interface Adapter
supportsNativeOffset
in class AbstractAdapter
public void generateLimits(Query query, long offset, int limit)
select * from TABLENAME fetch next 3 rows only; select * from TABLENAME offset 3 rows fetch next 3 rows only;
generateLimits
in interface Adapter
generateLimits
in class AbstractAdapter
query
- The query to modify.offset
- the offset value.limit
- the limit value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |