亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? loader.java

?? 好東西,hibernate-3.2.0,他是一開元的樹杖hibernate-3.2.0
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
//$Id: Loader.java 10139 2006-07-24 13:19:38Z max.andersen@jboss.com $
package org.hibernate.loader;

import java.io.Serializable;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.QueryException;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.StaleObjectStateException;
import org.hibernate.WrongClassException;
import org.hibernate.cache.FilterKey;
import org.hibernate.cache.QueryCache;
import org.hibernate.cache.QueryKey;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.EntityUniqueKey;
import org.hibernate.engine.PersistenceContext;
import org.hibernate.engine.QueryParameters;
import org.hibernate.engine.RowSelection;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.engine.SubselectFetch;
import org.hibernate.engine.TwoPhaseLoad;
import org.hibernate.engine.TypedValue;
import org.hibernate.event.EventSource;
import org.hibernate.event.PostLoadEvent;
import org.hibernate.event.PreLoadEvent;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.hql.HolderInstantiator;
import org.hibernate.impl.FetchingScrollableResultsImpl;
import org.hibernate.impl.ScrollableResultsImpl;
import org.hibernate.jdbc.ColumnNameCache;
import org.hibernate.jdbc.ResultSetWrapper;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.Loadable;
import org.hibernate.persister.entity.UniqueKeyLoadable;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.transform.ResultTransformer;
import org.hibernate.type.AssociationType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
import org.hibernate.type.VersionType;
import org.hibernate.util.StringHelper;

/**
 * Abstract superclass of object loading (and querying) strategies. This class implements
 * useful common functionality that concrete loaders delegate to. It is not intended that this
 * functionality would be directly accessed by client code. (Hence, all methods of this class
 * are declared <tt>protected</tt> or <tt>private</tt>.) This class relies heavily upon the
 * <tt>Loadable</tt> interface, which is the contract between this class and
 * <tt>EntityPersister</tt>s that may be loaded by it.<br>
 * <br>
 * The present implementation is able to load any number of columns of entities and at most
 * one collection role per query.
 *
 * @author Gavin King
 * @see org.hibernate.persister.entity.Loadable
 */
public abstract class Loader {

	private static final Log log = LogFactory.getLog( Loader.class );

	private final SessionFactoryImplementor factory;
	private ColumnNameCache columnNameCache;

	public Loader(SessionFactoryImplementor factory) {
		this.factory = factory;
	}

	/**
	 * The SQL query string to be called; implemented by all subclasses
	 */
	protected abstract String getSQLString();

	/**
	 * An array of persisters of entity classes contained in each row of results;
	 * implemented by all subclasses
	 */
	protected abstract Loadable[] getEntityPersisters();
	
	/**
	 * An array indicating whether the entities have eager property fetching
	 * enabled
	 */
	protected boolean[] getEntityEagerPropertyFetches() {
		return null;
	}

	/**
	 * An array of indexes of the entity that owns a one-to-one association
	 * to the entity at the given index (-1 if there is no "owner")
	 */
	protected int[] getOwners() {
		return null;
	}

	/**
	 * An array of unique key property names by which the corresponding
	 * entities are referenced by other entities in the result set
	 */
	protected EntityType[] getOwnerAssociationTypes() {
		return null;
	}

	/**
	 * An (optional) persister for a collection to be initialized; only 
	 * collection loaders return a non-null value
	 */
	protected CollectionPersister[] getCollectionPersisters() {
		return null;
	}

	/**
	 * Get the index of the entity that owns the collection, or -1
	 * if there is no owner in the query results (ie. in the case of a
	 * collection initializer) or no collection.
	 */
	protected int[] getCollectionOwners() {
		return null;
	}

	/**
	 * What lock mode does this load entities with?
	 *
	 * @param lockModes a collection of lock modes specified dynamically via the Query interface
	 */
	protected abstract LockMode[] getLockModes(Map lockModes);

	/**
	 * Append <tt>FOR UPDATE OF</tt> clause, if necessary. This
	 * empty superclass implementation merely returns its first
	 * argument.
	 */
	protected String applyLocks(String sql, Map lockModes, Dialect dialect) throws HibernateException {
		return sql;
	}

	/**
	 * Does this query return objects that might be already cached
	 * by the session, whose lock mode may need upgrading
	 */
	protected boolean upgradeLocks() {
		return false;
	}

	/**
	 * Return false is this loader is a batch entity loader
	 */
	protected boolean isSingleRowLoader() {
		return false;
	}

	/**
	 * Get the SQL table aliases of entities whose
	 * associations are subselect-loadable, returning
	 * null if this loader does not support subselect
	 * loading
	 */
	protected String[] getAliases() {
		return null;
	}

	/**
	 * Modify the SQL, adding lock hints and comments, if necessary
	 */
	protected String preprocessSQL(String sql, QueryParameters parameters, Dialect dialect)
			throws HibernateException {
		
		sql = applyLocks( sql, parameters.getLockModes(), dialect );
		
		return getFactory().getSettings().isCommentsEnabled() ?
				prependComment( sql, parameters ) : sql;
	}

	private String prependComment(String sql, QueryParameters parameters) {
		String comment = parameters.getComment();
		if ( comment == null ) {
			return sql;
		}
		else {
			return new StringBuffer( comment.length() + sql.length() + 5 )
					.append( "/* " )
					.append( comment )
					.append( " */ " )
					.append( sql )
					.toString();
		}
	}

	/**
	 * Execute an SQL query and attempt to instantiate instances of the class mapped by the given
	 * persister from each row of the <tt>ResultSet</tt>. If an object is supplied, will attempt to
	 * initialize that object. If a collection is supplied, attempt to initialize that collection.
	 */
	private List doQueryAndInitializeNonLazyCollections(final SessionImplementor session,
														final QueryParameters queryParameters,
														final boolean returnProxies) 
		throws HibernateException, SQLException {

		final PersistenceContext persistenceContext = session.getPersistenceContext();
		persistenceContext.beforeLoad();
		List result;
		try {
			result = doQuery( session, queryParameters, returnProxies );
		}
		finally {
			persistenceContext.afterLoad();
		}
		persistenceContext.initializeNonLazyCollections();
		return result;
	}

	/**
	 * Loads a single row from the result set.  This is the processing used from the
	 * ScrollableResults where no collection fetches were encountered.
	 *
	 * @param resultSet The result set from which to do the load.
	 * @param session The session from which the request originated.
	 * @param queryParameters The query parameters specified by the user.
	 * @param returnProxies Should proxies be generated
	 * @return The loaded "row".
	 * @throws HibernateException
	 */
	public Object loadSingleRow(
	        final ResultSet resultSet,
	        final SessionImplementor session,
	        final QueryParameters queryParameters,
	        final boolean returnProxies) throws HibernateException {

		final int entitySpan = getEntityPersisters().length;
		final List hydratedObjects = entitySpan == 0 ? 
				null : new ArrayList( entitySpan );

		final Object result;
		try {
			result = getRowFromResultSet(
			        resultSet,
					session,
					queryParameters,
					getLockModes( queryParameters.getLockModes() ),
					null,
					hydratedObjects,
					new EntityKey[entitySpan],
					returnProxies
				);
		}
		catch ( SQLException sqle ) {
			throw JDBCExceptionHelper.convert(
			        factory.getSQLExceptionConverter(),
			        sqle,
			        "could not read next row of results",
			        getSQLString()
				);
		}

		initializeEntitiesAndCollections( 
				hydratedObjects, 
				resultSet, 
				session, 
				queryParameters.isReadOnly() 
			);
		session.getPersistenceContext().initializeNonLazyCollections();
		return result;
	}

	private Object sequentialLoad(
	        final ResultSet resultSet,
	        final SessionImplementor session,
	        final QueryParameters queryParameters,
	        final boolean returnProxies,
	        final EntityKey keyToRead) throws HibernateException {

		final int entitySpan = getEntityPersisters().length;
		final List hydratedObjects = entitySpan == 0 ? 
				null : new ArrayList( entitySpan );

		Object result = null;
		final EntityKey[] loadedKeys = new EntityKey[entitySpan];

		try {
			do {
				Object loaded = getRowFromResultSet(
						resultSet,
						session,
						queryParameters,
						getLockModes( queryParameters.getLockModes() ),
						null,
						hydratedObjects,
						loadedKeys,
						returnProxies
					);
				if ( result == null ) {
					result = loaded;
				}
			} 
			while ( keyToRead.equals( loadedKeys[0] ) && resultSet.next() );
		}
		catch ( SQLException sqle ) {
			throw JDBCExceptionHelper.convert(
			        factory.getSQLExceptionConverter(),
			        sqle,
			        "could not perform sequential read of results (forward)",
			        getSQLString()
				);
		}

		initializeEntitiesAndCollections( 
				hydratedObjects, 
				resultSet, 
				session, 
				queryParameters.isReadOnly() 
			);
		session.getPersistenceContext().initializeNonLazyCollections();
		return result;
	}

	/**
	 * Loads a single logical row from the result set moving forward.  This is the
	 * processing used from the ScrollableResults where there were collection fetches
	 * encountered; thus a single logical row may have multiple rows in the underlying
	 * result set.
	 *
	 * @param resultSet The result set from which to do the load.
	 * @param session The session from which the request originated.
	 * @param queryParameters The query parameters specified by the user.
	 * @param returnProxies Should proxies be generated
	 * @return The loaded "row".
	 * @throws HibernateException
	 */
	public Object loadSequentialRowsForward(
	        final ResultSet resultSet,
	        final SessionImplementor session,
	        final QueryParameters queryParameters,
	        final boolean returnProxies) throws HibernateException {

		// note that for sequential scrolling, we make the assumption that
		// the first persister element is the "root entity"

		try {
			if ( resultSet.isAfterLast() ) {
				// don't even bother trying to read further
				return null;
			}

			if ( resultSet.isBeforeFirst() ) {
				resultSet.next();
			}

			// We call getKeyFromResultSet() here so that we can know the
			// key value upon which to perform the breaking logic.  However,
			// it is also then called from getRowFromResultSet() which is certainly
			// not the most efficient.  But the call here is needed, and there
			// currently is no other way without refactoring of the doQuery()/getRowFromResultSet()
			// methods
			final EntityKey currentKey = getKeyFromResultSet(
					0,
					getEntityPersisters()[0],
					null,
					resultSet,
					session
				);

			return sequentialLoad( resultSet, session, queryParameters, returnProxies, currentKey );
		}
		catch ( SQLException sqle ) {
			throw JDBCExceptionHelper.convert(
			        factory.getSQLExceptionConverter(),
			        sqle,
			        "could not perform sequential read of results (forward)",
			        getSQLString()
				);
		}
	}

	/**
	 * Loads a single logical row from the result set moving forward.  This is the
	 * processing used from the ScrollableResults where there were collection fetches
	 * encountered; thus a single logical row may have multiple rows in the underlying
	 * result set.
	 *
	 * @param resultSet The result set from which to do the load.
	 * @param session The session from which the request originated.
	 * @param queryParameters The query parameters specified by the user.
	 * @param returnProxies Should proxies be generated
	 * @return The loaded "row".
	 * @throws HibernateException
	 */
	public Object loadSequentialRowsReverse(
	        final ResultSet resultSet,
	        final SessionImplementor session,
	        final QueryParameters queryParameters,
	        final boolean returnProxies,
	        final boolean isLogicallyAfterLast) throws HibernateException {

		// note that for sequential scrolling, we make the assumption that
		// the first persister element is the "root entity"

		try {
			if ( resultSet.isFirst() ) {
				// don't even bother trying to read any further
				return null;
			}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级在线免费| 99久久国产综合色|国产精品| 国产三区在线成人av| 国产激情视频一区二区在线观看 | 亚洲成人午夜影院| 在线电影一区二区三区| 日韩电影免费在线看| 一本一本久久a久久精品综合麻豆| 久久久无码精品亚洲日韩按摩| 国产黄色精品视频| 欧美日韩高清一区二区三区| 国产亚洲制服色| 成人精品鲁一区一区二区| **性色生活片久久毛片| 7777精品伊人久久久大香线蕉超级流畅| 亚洲在线视频网站| 久久久久久久久久久久久夜| 在线观看亚洲成人| 久久成人羞羞网站| 一区二区三区四区在线免费观看 | 欧美色视频在线| 国产成人欧美日韩在线电影| 亚洲成av人片| 亚洲视频你懂的| 久久亚洲精华国产精华液| 欧美中文字幕久久| 丁香桃色午夜亚洲一区二区三区| 蜜臀91精品一区二区三区| 亚洲自拍偷拍网站| 中文字幕不卡一区| 国产亚洲综合av| 久久老女人爱爱| 欧美日韩一区三区四区| 99热99精品| 久久99精品久久久久久国产越南 | 国产精品每日更新| 91 com成人网| 91麻豆精品国产综合久久久久久| 成人午夜激情在线| 成人三级伦理片| av成人免费在线| 91蜜桃在线观看| 成人午夜伦理影院| 成人性生交大片免费看中文| 成人精品高清在线| 在线视频一区二区免费| 成人毛片视频在线观看| 国产麻豆午夜三级精品| 久久99久久99小草精品免视看| 极品尤物av久久免费看| 国产夫妻精品视频| 岛国一区二区在线观看| 国产成人在线视频免费播放| 97久久久精品综合88久久| 国产iv一区二区三区| av网站一区二区三区| 精品亚洲国产成人av制服丝袜| 成人丝袜18视频在线观看| 成人午夜伦理影院| 538prom精品视频线放| 国产亚洲精品bt天堂精选| 国产精品午夜免费| 亚洲第一av色| 91在线高清观看| 91麻豆精品国产91久久久| 久久亚洲精华国产精华液| 精品裸体舞一区二区三区| 久久久精品影视| 亚洲精品午夜久久久| 国产精品小仙女| 欧美日韩一区视频| 亚洲欧洲在线观看av| 蜜桃视频一区二区三区 | 亚洲精品国产无天堂网2021| 久久丁香综合五月国产三级网站 | 日日夜夜精品视频天天综合网| 成人性生交大片免费看中文| 欧美理论电影在线| 亚洲色图制服诱惑 | 亚洲免费观看在线观看| 国产精品一区二区三区99| 欧美videofree性高清杂交| 亚洲国产综合视频在线观看| 99久久er热在这里只有精品15| 69堂亚洲精品首页| 午夜激情一区二区| 欧美中文字幕一二三区视频| 欧美久久久久久久久中文字幕| 日韩三级视频中文字幕| 亚洲一区二区三区四区在线观看| 97久久精品人人爽人人爽蜜臀| 国产精品久久久久久久岛一牛影视| 亚洲午夜一区二区三区| 91亚洲永久精品| 欧美国产乱子伦| aaa亚洲精品| 亚洲第一会所有码转帖| 欧美人狂配大交3d怪物一区| 丝袜脚交一区二区| 欧美三级电影一区| 麻豆精品视频在线观看免费| 欧美片在线播放| 国产乱色国产精品免费视频| 1000部国产精品成人观看| 日本道色综合久久| 久久九九99视频| www.视频一区| 日韩国产高清影视| 精品99一区二区| 日本大胆欧美人术艺术动态| 91香蕉视频在线| **网站欧美大片在线观看| 日韩黄色在线观看| 久久综合五月天婷婷伊人| 不卡的av在线播放| 日本视频一区二区| 亚洲婷婷国产精品电影人久久| 欧美色图免费看| 国产一区在线视频| 天堂在线一区二区| 亚洲另类中文字| 一区二区三区高清不卡| 一区精品在线播放| 99久久精品免费| 久久午夜国产精品| 国产一区视频在线看| 久久久久久久精| 国产精品一区二区三区网站| 久久精品视频一区| 不卡一区在线观看| 亚洲欧美日韩国产手机在线| 欧美日韩国产成人在线免费| 视频一区视频二区中文字幕| 91精品啪在线观看国产60岁| 亚洲女人的天堂| 欧美视频日韩视频| 视频一区视频二区中文| 一本大道久久a久久精二百| 亚洲另类春色国产| 欧美精品免费视频| 手机精品视频在线观看| 久久亚洲精品国产精品紫薇| 粉嫩蜜臀av国产精品网站| 国产人久久人人人人爽| 91一区在线观看| 丝袜a∨在线一区二区三区不卡| 欧美成人福利视频| 成人福利在线看| 亚洲高清免费观看| 精品国产区一区| 成人免费观看男女羞羞视频| 亚洲美女一区二区三区| 欧美福利视频导航| 国产风韵犹存在线视精品| 亚洲视频一二三| 在线电影院国产精品| 国内成人精品2018免费看| 国产精品日韩成人| 欧美亚洲愉拍一区二区| 91久久精品日日躁夜夜躁欧美| 国产精品国产成人国产三级| 91国产成人在线| 国产成人午夜高潮毛片| 亚洲一区在线观看视频| 国产日韩三级在线| 777午夜精品免费视频| 国产精品影视天天线| 午夜欧美大尺度福利影院在线看 | 91精品国产色综合久久| 国产凹凸在线观看一区二区| 亚洲最大色网站| 555夜色666亚洲国产免| 国产jizzjizz一区二区| 男男视频亚洲欧美| 亚洲乱码日产精品bd| 久久影院视频免费| 99精品欧美一区二区三区小说| 狠狠色丁香婷婷综合久久片| 亚洲成人一区二区| 国产精品国产三级国产有无不卡| 精品精品国产高清一毛片一天堂| 91美女在线观看| av在线一区二区三区| 久久精品免费观看| 午夜电影一区二区| 综合色中文字幕| 国产日产欧美精品一区二区三区| 日韩精品中午字幕| 欧美日韩精品欧美日韩精品一| 91蜜桃视频在线| 国产综合久久久久影院| 免费观看在线综合色| 丝袜美腿亚洲一区| 一区二区三区在线观看视频 | 蜜桃一区二区三区四区| 日韩在线一二三区| 洋洋av久久久久久久一区| 1024成人网| 国产精品三级视频| 国产日韩视频一区二区三区|