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

📄 queryimpl.java

📁 用Java实现的23个常用设计模式源代码
💻 JAVA
字号:
//$Id: QueryImpl.java,v 1.19.2.7 2003/11/02 08:56:48 oneovthafew Exp $package net.sf.hibernate.impl;import java.util.Iterator;import java.util.List;import java.util.Map;import net.sf.hibernate.HibernateException;import net.sf.hibernate.Query;import net.sf.hibernate.ScrollableResults;import net.sf.hibernate.engine.QueryParameters;import net.sf.hibernate.engine.SessionImplementor;/** * default implementation of the <tt>Query</tt> interface, * for "ordinary" HQL queries (not collection filters) * @see FilterImpl * @author Gavin King */public class QueryImpl extends AbstractQueryImpl {		private boolean cacheable;	private String cacheRegion;	public QueryImpl(String queryString, SessionImplementor session) {		super(queryString, session);						this.cacheRegion = null;	}		public Iterator iterate() throws HibernateException {		verifyParameters();		Map namedParams = getNamedParams();		return getSession().iterate( bindParameterLists(namedParams), getQueryParameters(namedParams) );	}		public ScrollableResults scroll() throws HibernateException {		verifyParameters();		Map namedParams = getNamedParams();		return getSession().scroll( bindParameterLists(namedParams), getQueryParameters(namedParams) );	}		public List list() throws HibernateException {		verifyParameters();		Map namedParams = getNamedParams();		return getSession().find( bindParameterLists(namedParams), getQueryParameters(namedParams) );	}		public Query setCacheable(boolean cacheable) {		this.cacheable = cacheable;		return this;	}		public Query setCacheRegion(String cacheRegion) {		this.cacheRegion = cacheRegion.trim();		return this;	}	public QueryParameters getQueryParameters(Map namedParams) {		QueryParameters result = super.getQueryParameters(namedParams);		result.setCacheable(cacheable);		result.setCacheRegion(cacheRegion);		return result;	}	}

⌨️ 快捷键说明

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