|
|
|||||||||||
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 Database
close
in interface Transaction
close
in class TransactionImplementation
public void commit()
Transaction
commit
in interface Database
commit
in interface Transaction
commit
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 TransactionImplementation
type
- 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 Database
getName
in interface Transaction
getName
in class TransactionImplementation
public void lock(String symbol)
Transaction
lock
in interface Database
lock
in interface Transaction
lock
in class TransactionImplementation
public void rollback()
Transaction
rollback
in interface Database
rollback
in interface Transaction
rollback
in class TransactionImplementation
public void unlock(String symbol)
Transaction
unlock
in interface Database
unlock
in interface Transaction
unlock
in class TransactionImplementation
public Vector<Dictionary<String,Object>> executeQuery(String query, Object args, int offset, int limit)
executeQuery
in interface Database
executeQuery
in interface Transaction
executeQuery
in class TransactionImplementation
query
- 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 Database
executeQuery
in interface Transaction
executeQuery
in class TransactionImplementation
query
- 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)
Transaction
Transaction.insert(String, Dictionary)
, only
that a collection is provided instead of a single Dictionary.
insert
in interface Transaction
insert
in class TransactionImplementation
type
- 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 TransactionImplementation
public String transformTypeName(String name)
transformTypeName
in class TransactionImplementation
public String getParameterName()
getParameterName
in class TransactionImplementation
public String getPrimaryKeyName()
getPrimaryKeyName
in class TransactionImplementation
public String getSetJoinSyntax()
getSetJoinSyntax
in class TransactionImplementation
public String getPrimaryKeyName(String s)
getPrimaryKeyName
in class TransactionImplementation
public String getNullConstant()
getNullConstant
in class TransactionImplementation
public String getDataSource()
Transaction
getDataSource
in interface Transaction
getDataSource
in class TransactionImplementation
public 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 |