⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nonbatchingbatcher.java

📁 用Java实现的23个常用设计模式源代码
💻 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 + -