|
|
|||||||||||
| 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.hibernate.HibernateTransaction
public class HibernateTransaction
Hibernate-specific implementation of a Transaction
| Field Summary | |
|---|---|
(package private) static Pattern |
namedParam
|
org.hibernate.Session |
s
|
org.hibernate.Transaction |
t
|
| Fields inherited from class org.makumba.db.TransactionImplementation |
|---|
qp, tp |
| Constructor Summary | |
|---|---|
HibernateTransaction(String dataSource,
DataDefinitionProvider ddp,
HibernateTransactionProvider hibernateTransactionProvider)
|
|
HibernateTransaction(TransactionProvider tp)
|
|
| Method Summary | |
|---|---|
org.hibernate.Transaction |
beginTransaction()
|
void |
close()
Give this connection back to the system. |
void |
commit()
Commit the transaction associated with this connection. |
Vector<Dictionary<String,Object>> |
execute(String query,
Object args,
int offset,
int limit)
|
Vector<Dictionary<String,Object>> |
executeQuery(String query,
Object parameterValues)
Executes a query with the given parameters. |
Vector<Dictionary<String,Object>> |
executeQuery(String query,
Object args,
int offset,
int limit)
Executes a query with the given parameters. |
protected Vector |
executeReadQuery(Pointer p,
StringBuffer sb)
|
protected int |
executeUpdate(String type,
String set,
String where,
Object args)
Executes an UPDATE statement or a DELETE FROM statement, depending on the value of set. |
String |
getDataSource()
Returns the name of the data source to which this Transaction is connected |
String |
getName()
Get the name of the database in the form host[_port]_dbprotocol_dbname |
String |
getNullConstant()
|
String |
getParameterName()
|
String |
getPrimaryKeyName()
|
String |
getPrimaryKeyName(String s)
|
String |
getSetJoinSyntax()
|
Vector<Pointer> |
insert(String type,
Collection<Dictionary<String,Object>> data)
Performs a batch insert. |
protected int |
insertFromQueryImpl(String type,
String OQL,
Object parameterValues)
|
void |
lock(String symbol)
Acquire a lock associated to the given application-specific symbol. |
void |
rollback()
Rollback the transaction associated with this connection. |
String |
transformTypeName(String name)
|
protected Object[] |
treatParam(Object args)
|
void |
unlock(String symbol)
Free the lock on the given symbol, if any exists. |
protected StringBuffer |
writeReadQuery(Pointer p,
Enumeration e)
|
| Methods inherited from class org.makumba.db.TransactionImplementation |
|---|
delete, delete, delete1, extractReadFields, getTransactionProvider, insert, insert, insertFromQuery, paramsToMap, paramsToMap1, read, readCharEnumValues, readExternalSetValues, readIntEnumValues, readSetValues, setContext, update, update, updateSet, updateWithValueDiff |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public org.hibernate.Transaction t
public org.hibernate.Session s
static Pattern namedParam
| Constructor Detail |
|---|
public HibernateTransaction(TransactionProvider tp)
public HibernateTransaction(String dataSource,
DataDefinitionProvider ddp,
HibernateTransactionProvider hibernateTransactionProvider)
| Method Detail |
|---|
public void close()
Transaction
close in interface Databaseclose in interface Transactionclose in class TransactionImplementationpublic void commit()
Transaction
commit in interface Databasecommit in interface Transactioncommit in class TransactionImplementation
protected StringBuffer writeReadQuery(Pointer p,
Enumeration e)
writeReadQuery in class TransactionImplementation
protected Vector executeReadQuery(Pointer p,
StringBuffer sb)
executeReadQuery in class TransactionImplementation
protected int executeUpdate(String type,
String set,
String where,
Object args)
TransactionImplementation
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
INSERT, UPDATE, or DELETE statements
or (2) 0 for SQL statements that return nothingpublic String getName()
Transaction
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 rollback()
Transaction
rollback in interface Databaserollback in interface Transactionrollback in class TransactionImplementationpublic void unlock(String symbol)
Transaction
unlock in interface Databaseunlock in interface Transactionunlock in class TransactionImplementation
public Vector<Dictionary<String,Object>> executeQuery(String query,
Object args,
int offset,
int limit)
executeQuery in interface DatabaseexecuteQuery in interface TransactionexecuteQuery in class TransactionImplementationquery - the HQL queryargs - the parameters of the query. Can be a Map containing named parameters, or a Vector, Object[] or Object
for not named parameters.offset - the offset from which the results should be returnedlimit - the maximum number of results to be returned
public Vector<Dictionary<String,Object>> executeQuery(String query,
Object parameterValues)
executeQuery in interface DatabaseexecuteQuery in interface TransactionexecuteQuery in class TransactionImplementationquery - the HQL queryargs - the parameters of the query. Can be a Map containing named parameters, or a Vector, Object[] or Object
for not named parameters.
Transaction.executeQuery(java.lang.String,java.lang.Object,int,int)
public Vector<Dictionary<String,Object>> execute(String query,
Object args,
int offset,
int limit)
public Vector<Pointer> insert(String type,
Collection<Dictionary<String,Object>> data)
TransactionTransaction.insert(String, Dictionary), only
that a collection is provided instead of a single Dictionary.
insert in interface Transactioninsert in class TransactionImplementationtype - the makumba type to create a new record fordata - a set of field-value mapping for the new record.
protected int insertFromQueryImpl(String type,
String OQL,
Object parameterValues)
insertFromQueryImpl in class TransactionImplementationpublic String transformTypeName(String name)
transformTypeName in class TransactionImplementationpublic String getParameterName()
getParameterName in class TransactionImplementationpublic String getPrimaryKeyName()
getPrimaryKeyName in class TransactionImplementationpublic String getSetJoinSyntax()
getSetJoinSyntax in class TransactionImplementationpublic String getPrimaryKeyName(String s)
getPrimaryKeyName in class TransactionImplementationpublic String getNullConstant()
getNullConstant in class TransactionImplementationpublic String getDataSource()
Transaction
getDataSource in interface TransactiongetDataSource in class TransactionImplementationpublic org.hibernate.Transaction beginTransaction()
protected Object[] treatParam(Object args)
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||