|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.impl.BatcherImpl
Manages prepared statements and batching.
| Field Summary | |
protected static org.apache.commons.logging.Log |
log
|
protected static org.apache.commons.logging.Log |
sqlLog
|
| Constructor Summary | |
BatcherImpl(SessionImplementor session)
|
|
| Method Summary | |
void |
abortBatch(SQLException sqle)
Must be called when an exception occurs |
void |
cancelLastQuery()
Cancel the current query statement |
void |
closeConnection(Connection conn)
Dispose of the JDBC connection |
void |
closeQueryStatement(PreparedStatement ps,
ResultSet rs)
Close a prepared statement opened with prepareQueryStatement() |
void |
closeStatement(PreparedStatement ps)
Close a prepared statement opened using prepareStatement() |
void |
closeStatements()
Close any query statements that were left lying around |
protected JDBCException |
convert(SQLException sqlException,
String message)
|
protected abstract void |
doExecuteBatch(PreparedStatement ps)
|
void |
executeBatch()
Execute the batch |
protected SessionFactoryImplementor |
getFactory()
|
ResultSet |
getResultSet(PreparedStatement ps)
Execute the statement and return the result set |
protected SessionImplementor |
getSession()
|
protected PreparedStatement |
getStatement()
|
Connection |
openConnection()
Obtain a JDBC connection |
PreparedStatement |
prepareBatchStatement(String sql)
Get a batchable prepared statement to use for inserting / deleting / updating (might be called many times before a single call to executeBatch()). |
PreparedStatement |
prepareQueryStatement(String sql,
boolean scrollable,
ScrollMode scrollMode)
Get a prepared statement for use in loading / querying. |
PreparedStatement |
prepareStatement(String sql)
Get a non-batchable prepared statement to use for inserting / deleting / updating. |
PreparedStatement |
prepareStatement(String sql,
boolean getGeneratedKeys)
Get a non-batchable prepared statement to use for inserting / deleting / updating. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.hibernate.engine.Batcher |
addToBatch |
| Field Detail |
protected static final org.apache.commons.logging.Log log
protected static final org.apache.commons.logging.Log sqlLog
| Constructor Detail |
public BatcherImpl(SessionImplementor session)
| Method Detail |
protected PreparedStatement getStatement()
public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException
Batcher
prepareStatement in interface BatcherSQLException
HibernateExceptionpublic PreparedStatement prepareStatement(String sql, boolean getGeneratedKeys) throws SQLException, HibernateException
Batcher
prepareStatement in interface BatcherSQLException
HibernateExceptionpublic PreparedStatement prepareQueryStatement(String sql, boolean scrollable, ScrollMode scrollMode) throws SQLException, HibernateException
Batcher
prepareQueryStatement in interface BatcherSQLException
HibernateExceptionpublic void abortBatch(SQLException sqle)
Batcher
abortBatch in interface Batchersqle - the (not null) exception that is the reason for abortingpublic ResultSet getResultSet(PreparedStatement ps) throws SQLException
Batcher
getResultSet in interface BatcherSQLExceptionpublic void closeQueryStatement(PreparedStatement ps, ResultSet rs) throws SQLException
Batcher
closeQueryStatement in interface BatcherSQLExceptionpublic PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException
Batcher
prepareBatchStatement in interface BatcherSQLException
HibernateExceptionBatcher.addToBatch(int)
public void executeBatch()
throws HibernateException
Batcher
executeBatch in interface BatcherHibernateExceptionpublic void closeStatement(PreparedStatement ps) throws SQLException
Batcher
closeStatement in interface BatcherSQLExceptionpublic void closeStatements()
Batcher
closeStatements in interface Batcherprotected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException
SQLException
HibernateExceptionprotected SessionImplementor getSession()
protected SessionFactoryImplementor getFactory()
public Connection openConnection() throws HibernateException
Batcher
openConnection in interface BatcherHibernateExceptionpublic void closeConnection(Connection conn) throws HibernateException
Batcher
closeConnection in interface BatcherHibernateException
public void cancelLastQuery()
throws HibernateException
Batcher
cancelLastQuery in interface BatcherHibernateExceptionprotected JDBCException convert(SQLException sqlException, String message)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||