se.unlogic.standardutils.dao
Class TransactionHandler

java.lang.Object
  extended by se.unlogic.standardutils.dao.TransactionHandler

public class TransactionHandler
extends java.lang.Object


Constructor Summary
TransactionHandler(java.sql.Connection connection)
           
TransactionHandler(javax.sql.DataSource dataSource)
           
 
Method Summary
 void abort()
           
static void autoClose(TransactionHandler transactionHandler)
           
 void commit()
           
protected  void finalize()
           
<T> ArrayListQuery<T>
getArrayListQuery(java.lang.String sql, BeanResultSetPopulator<T> populator)
           
 BooleanQuery getBooleanQuery(java.lang.String sql)
           
<K,V> HashMapQuery<K,V>
getHashMapQuery(java.lang.String sql, BeanResultSetPopulator<? extends java.util.Map.Entry<K,V>> populator)
           
<T> ObjectQuery<T>
getObjectQuery(java.lang.String sql, BeanResultSetPopulator<T> populator)
           
 int getQueryCount()
           
 UpdateQuery getUpdateQuery(java.lang.String sqlExpression)
           
 boolean isAborted()
           
 boolean isClosed()
           
 boolean isCommited()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionHandler

public TransactionHandler(javax.sql.DataSource dataSource)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

TransactionHandler

public TransactionHandler(java.sql.Connection connection)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getUpdateQuery

public UpdateQuery getUpdateQuery(java.lang.String sqlExpression)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getBooleanQuery

public BooleanQuery getBooleanQuery(java.lang.String sql)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getObjectQuery

public <T> ObjectQuery<T> getObjectQuery(java.lang.String sql,
                                         BeanResultSetPopulator<T> populator)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

getArrayListQuery

public <T> ArrayListQuery<T> getArrayListQuery(java.lang.String sql,
                                               BeanResultSetPopulator<T> populator)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getHashMapQuery

public <K,V> HashMapQuery<K,V> getHashMapQuery(java.lang.String sql,
                                               BeanResultSetPopulator<? extends java.util.Map.Entry<K,V>> populator)
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException
Throws:
java.sql.SQLException

getQueryCount

public int getQueryCount()

abort

public void abort()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

isClosed

public boolean isClosed()

autoClose

public static void autoClose(TransactionHandler transactionHandler)

isAborted

public boolean isAborted()

isCommited

public boolean isCommited()


Copyright © 2011. All Rights Reserved.