|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.makumba.db.TransactionImplementation
org.makumba.db.makumba.DBConnection
public abstract class DBConnection
This is the Makumba-specific implementation of a Transaction
| Nested Class Summary | |
|---|---|
(package private) class |
DBConnection.QueryAndArgs
|
| Field Summary | |
|---|---|
protected String |
dataSource
|
protected Database |
db
|
(package private) Hashtable<String,Object> |
lockRecord
|
(package private) Map<String,Pointer> |
locks
|
(package private) NamedResources |
queries
|
(package private) static String |
whereDelim
|
| Fields inherited from class org.makumba.db.TransactionImplementation |
|---|
ddp, qp, tp |
| Constructor Summary | |
|---|---|
|
DBConnection(Database database,
String dataSource,
TransactionProvider tp)
|
|
DBConnection(Database database,
TransactionProvider tp)
|
protected |
DBConnection(TransactionProvider tp)
|
| Method Summary | |
|---|---|
protected void |
deleteLock(String symbol)
|
Vector<Dictionary<String,Object>> |
executeQuery(String OQL,
Object args)
Execute query without limiting the results. |
Vector<Dictionary<String,Object>> |
executeQuery(String OQL,
Object args,
int offset,
int limit)
Execute a parametrized OQL query. |
protected Vector<Dictionary<String,Object>> |
executeReadQuery(Pointer p,
StringBuffer sb)
|
int |
executeUpdate(String type,
String set,
String where,
Object args)
Execute a parametrized update or delete. |
String |
getDataSource()
Returns the name of the data source to which this Transaction is connected |
Database |
getHostDatabase()
|
String |
getName()
Get the name of the database in the form host[_port]_dbprotocol_dbname |
String |
getNullConstant()
|
Query |
getQuery(String OQL)
|
Pointer |
insert(String type,
Dictionary<String,Object> data)
insert a record |
int |
insertFromQuery(String type,
String OQL,
Object args)
Insert the results of the query in the given type. |
void |
lock(String symbol)
Acquire a lock associated to the given application-specific symbol. |
void |
setDataSource(String dataSource)
|
void |
unlock(String symbol)
Free the lock on the given symbol, if any exists. |
protected void |
unlockAll()
|
protected StringBuffer |
writeReadQuery(Pointer p,
Enumeration<String> e)
|
| Methods inherited from class org.makumba.db.TransactionImplementation |
|---|
close, commit, delete, delete, delete1, extractReadFields, getParameterName, getPrimaryKeyName, getPrimaryKeyName, getSetJoinSyntax, getTransactionProvider, insert, paramsToMap, paramsToMap1, read, rollback, setContext, transformTypeName, treatParam, update, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String dataSource
protected Database db
Map<String,Pointer> locks
Hashtable<String,Object> lockRecord
NamedResources queries
static final String whereDelim
| Constructor Detail |
|---|
protected DBConnection(TransactionProvider tp)
public DBConnection(Database database,
TransactionProvider tp)
public DBConnection(Database database,
String dataSource,
TransactionProvider tp)
| Method Detail |
|---|
public Database getHostDatabase()
public String getName()
getName in interface DatabasegetName in interface TransactiongetName in class TransactionImplementationpublic void lock(String symbol)
Transaction
lock in interface Databaselock in interface Transactionlock in class TransactionImplementationpublic void unlock(String symbol)
Transaction
unlock in interface Databaseunlock in interface Transactionunlock in class TransactionImplementationprotected void deleteLock(String symbol)
protected void unlockAll()
protected StringBuffer writeReadQuery(Pointer p,
Enumeration<String> e)
writeReadQuery in class TransactionImplementation
protected Vector<Dictionary<String,Object>> executeReadQuery(Pointer p,
StringBuffer sb)
executeReadQuery in class TransactionImplementation
public Pointer insert(String type,
Dictionary<String,Object> data)
insert in interface Databaseinsert in interface Transactioninsert in class TransactionImplementationtype - the makumba type to create a new record fordata - the field-value mapping for the new record.
public Vector<Dictionary<String,Object>> executeQuery(String OQL,
Object args,
int offset,
int limit)
executeQuery in interface DatabaseexecuteQuery in interface TransactionexecuteQuery in class TransactionImplementationOQL - the query to execute. Refers to parameters as $1, $2 ...args - the arguments of the queries. Should be null if there are none. If there is only one parameter, it can be indicated directly. If there are more parameters, they can be indicated in a Object[] or a java.util.Vector. Named parameters can be indicated in a Map.offset - the offset of the first record to return, 0 for firstlimit - the maximum number of records to return, -1 for all
public int insertFromQuery(String type,
String OQL,
Object args)
Transaction
insertFromQuery in interface TransactioninsertFromQuery in class TransactionImplementationtype - the type where to insertOQL - the OQL query to execute. Refers to parameters as $1, $2 ...args - the parameter values. Should be null if there are no parameters. If there is only one parameter, it can be indicated directly. If there are more parameters, they can be indicated in a Object[] or a java.util.Vector
public Vector<Dictionary<String,Object>> executeQuery(String OQL,
Object args)
Transaction
executeQuery in interface DatabaseexecuteQuery in interface TransactionexecuteQuery in class TransactionImplementationTransaction.executeQuery(java.lang.String,java.lang.Object,int,int)
public int executeUpdate(String type,
String set,
String where,
Object args)
executeUpdate in class TransactionImplementationtype - the type on which to perform the operationset - the SET part of the query. if null, this performs a DELETE FROM statementwhere - the WHERE part of the queryargs - the query arguments
public Query getQuery(String OQL)
public String getNullConstant()
getNullConstant in class TransactionImplementationpublic String getDataSource()
Transaction
getDataSource in interface TransactiongetDataSource in class TransactionImplementationpublic void setDataSource(String dataSource)
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||