📄 nonbatchingbatcher.java
字号:
//$Id: NonBatchingBatcher.java,v 1.4.2.3 2003/08/04 11:26:46 oneovthafew Exp $package net.sf.hibernate.impl;import java.sql.PreparedStatement;import java.sql.SQLException;import net.sf.hibernate.HibernateException;import net.sf.hibernate.engine.SessionImplementor;/** * An implementation of the <tt>Batcher</tt> interface that does no batching * * @author Gavin King */public class NonBatchingBatcher extends BatcherImpl { public NonBatchingBatcher(SessionImplementor session) { super(session); } public void addToBatch(int expectedRowCount) throws SQLException, HibernateException { int rowCount = getStatement().executeUpdate(); //negative expected row count means we don't know how many rows to expect if ( expectedRowCount>0 && expectedRowCount!=rowCount ) throw new HibernateException("SQL update or deletion failed (row not found)"); } protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException { } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -