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

📄 commondao.java

📁 工厂版本管理系统,STRUTS2框架,用于管理商品的版本,便于有效的控制版本
💻 JAVA
字号:
package com.bluesky.common.dao.hibernate;import java.io.Serializable;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.hibernate.Session;import org.springframework.orm.hibernate3.HibernateTemplate;import org.springframework.orm.hibernate3.support.HibernateDaoSupport;import com.bluesky.common.dao.ICommonDao;public class CommonDao extends HibernateDaoSupport implements ICommonDao {	private Log log = LogFactory.getLog(this.getClass());		public void truncateDB(String[] tableNames) {		Session s = getHibernateTemplate().getSessionFactory()				.getCurrentSession();						for(int i=0;i<tableNames.length;i++){			log.info("deleting table "+tableNames[i]);			String sql = String.format("truncate table %s", tableNames[i]);			s.createSQLQuery(sql).executeUpdate();		}	}		public HibernateTemplate getHibTemplate(){		return getHibernateTemplate();	}		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -