|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 Batcher
SQLException
HibernateException
public PreparedStatement prepareStatement(String sql, boolean getGeneratedKeys) throws SQLException, HibernateException
Batcher
prepareStatement
in interface Batcher
SQLException
HibernateException
public PreparedStatement prepareQueryStatement(String sql, boolean scrollable, ScrollMode scrollMode) throws SQLException, HibernateException
Batcher
prepareQueryStatement
in interface Batcher
SQLException
HibernateException
public void abortBatch(SQLException sqle)
Batcher
abortBatch
in interface Batcher
sqle
- the (not null) exception that is the reason for abortingpublic ResultSet getResultSet(PreparedStatement ps) throws SQLException
Batcher
getResultSet
in interface Batcher
SQLException
public void closeQueryStatement(PreparedStatement ps, ResultSet rs) throws SQLException
Batcher
closeQueryStatement
in interface Batcher
SQLException
public PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException
Batcher
prepareBatchStatement
in interface Batcher
SQLException
HibernateException
Batcher.addToBatch(int)
public void executeBatch() throws HibernateException
Batcher
executeBatch
in interface Batcher
HibernateException
public void closeStatement(PreparedStatement ps) throws SQLException
Batcher
closeStatement
in interface Batcher
SQLException
public void closeStatements()
Batcher
closeStatements
in interface Batcher
protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException
SQLException
HibernateException
protected SessionImplementor getSession()
protected SessionFactoryImplementor getFactory()
public Connection openConnection() throws HibernateException
Batcher
openConnection
in interface Batcher
HibernateException
public void closeConnection(Connection conn) throws HibernateException
Batcher
closeConnection
in interface Batcher
HibernateException
public void cancelLastQuery() throws HibernateException
Batcher
cancelLastQuery
in interface Batcher
HibernateException
protected JDBCException convert(SQLException sqlException, String message)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |