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

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

?? foreignkeys.java

?? hibernate-3.0.5 中文文檔
?? JAVA
字號:
//$Id: ForeignKeys.java,v 1.15 2005/04/10 19:29:07 oneovthafew Exp $package org.hibernate.engine;import java.io.Serializable;import org.hibernate.HibernateException;import org.hibernate.TransientObjectException;import org.hibernate.intercept.LazyPropertyInitializer;import org.hibernate.persister.entity.EntityPersister;import org.hibernate.proxy.HibernateProxy;import org.hibernate.proxy.LazyInitializer;import org.hibernate.type.AbstractComponentType;import org.hibernate.type.EntityType;import org.hibernate.type.Type;/** * Algorithms related to foreign key constraint transparency *  * @author Gavin King */public final class ForeignKeys {		private ForeignKeys() {}		public static class Nullifier {			private final boolean isDelete;		private final boolean isEarlyInsert;		private final SessionImplementor session;		private final Object self;				public Nullifier(Object self, boolean isDelete, boolean isEarlyInsert, SessionImplementor session) {			this.isDelete = isDelete;			this.isEarlyInsert = isEarlyInsert;			this.session = session;			this.self = self;		}				/**		 * Nullify all references to entities that have not yet 		 * been inserted in the database, where the foreign key		 * points toward that entity		 */		public void nullifyTransientReferences(final Object[] values, final Type[] types) 		throws HibernateException {			for ( int i = 0; i < types.length; i++ ) {				values[i] = nullifyTransientReferences( values[i], types[i] );			}		}			/**		 * Return null if the argument is an "unsaved" entity (ie. 		 * one with no existing database row), or the input argument 		 * otherwise. This is how Hibernate avoids foreign key constraint		 * violations.		 */		private Object nullifyTransientReferences(final Object value, final Type type) 		throws HibernateException {			if ( value == null ) {				return null;			}			else if ( type.isEntityType() ) {				EntityType entityType = (EntityType) type;				if ( entityType.isOneToOne() ) {					return value;				}				else {					String entityName = entityType.getAssociatedEntityName();					return isNullifiable(entityName, value) ? null : value;				}			}			else if ( type.isAnyType() ) {				return isNullifiable(null, value) ? null : value;			}			else if ( type.isComponentType() ) {				AbstractComponentType actype = (AbstractComponentType) type;				Object[] subvalues = actype.getPropertyValues(value, session);				Type[] subtypes = actype.getSubtypes();				boolean substitute = false;				for ( int i = 0; i < subvalues.length; i++ ) {					Object replacement = nullifyTransientReferences( subvalues[i], subtypes[i] );					if ( replacement != subvalues[i] ) {						substitute = true;						subvalues[i] = replacement;					}				}				if (substitute) actype.setPropertyValues( value, subvalues, session.getEntityMode() );				return value;			}			else {				return value;			}		}			/**		 * Determine if the object already exists in the database, 		 * using a "best guess"		 */		private boolean isNullifiable(final String entityName, Object object) 		throws HibernateException {						if (object==LazyPropertyInitializer.UNFETCHED_PROPERTY) return false; //this is kinda the best we can do...						if ( object instanceof HibernateProxy ) {				// if its an uninitialized proxy it can't be transient				LazyInitializer li = ( (HibernateProxy) object ).getHibernateLazyInitializer();				if ( li.getImplementation(session) == null ) {					return false;					// ie. we never have to null out a reference to					// an uninitialized proxy				}				else {					//unwrap it					object = li.getImplementation();				}			}				// if it was a reference to self, don't need to nullify			// unless we are using native id generation, in which			// case we definitely need to nullify			if ( object == self ) {				return isEarlyInsert || (					isDelete &&					session.getFactory()						.getDialect()						.hasSelfReferentialForeignKeyBug()				);			}				// See if the entity is already bound to this session, if not look at the			// entity identifier and assume that the entity is persistent if the			// id is not "unsaved" (that is, we rely on foreign keys to keep			// database integrity)				EntityEntry entityEntry = session.getPersistenceContext().getEntry(object);			if ( entityEntry==null ) {				return isTransient(entityName, object, null, session);			}			else {				return entityEntry.isNullifiable(isEarlyInsert, session);			}			}			}		/**	 * Is this instance persistent or detached?	 * If <tt>assumed</tt> is non-null, don't hit the database to make the 	 * determination, instead assume that value; the client code must be 	 * prepared to "recover" in the case that this assumed result is incorrect.	 */	public static boolean isNotTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) 	throws HibernateException {		if (entity instanceof HibernateProxy) return true;		if ( session.getPersistenceContext().isEntryFor(entity) ) return true;		return !isTransient(entityName, entity, assumed, session);	}		/**	 * Is this instance, which we know is not persistent, actually transient?	 * If <tt>assumed</tt> is non-null, don't hit the database to make the 	 * determination, instead assume that value; the client code must be 	 * prepared to "recover" in the case that this assumed result is incorrect.	 */	public static boolean isTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) 	throws HibernateException {				if (entity==LazyPropertyInitializer.UNFETCHED_PROPERTY) {			// an unfetched association can only point to			// an entity that already exists in the db			return false;		}				// let the interceptor inspect the instance to decide		Boolean isUnsaved = session.getInterceptor().isTransient(entity);		if (isUnsaved!=null) return isUnsaved.booleanValue();				// let the persister inspect the instance to decide		EntityPersister persister = session.getEntityPersister(entityName, entity);		isUnsaved = persister.isTransient(entity, session);		if (isUnsaved!=null) return isUnsaved.booleanValue();		// we use the assumed value, if there is one, to avoid hitting		// the database		if (assumed!=null) return assumed.booleanValue();				// hit the database, after checking the session cache for a snapshot		Object[] snapshot = session.getPersistenceContext()		        .getDatabaseSnapshot( persister.getIdentifier( entity, session.getEntityMode() ), persister );		return snapshot==null;	}	/**	 * Return the identifier of the persistent or transient object, or throw	 * an exception if the instance is "unsaved"	 *	 * Used by OneToOneType and ManyToOneType to determine what id value should 	 * be used for an object that may or may not be associated with the session. 	 * This does a "best guess" using any/all info available to use (not just the 	 * EntityEntry).	 */	public static Serializable getEntityIdentifierIfNotUnsaved(			final String entityName, 			final Object object, 			final SessionImplementor session) 	throws HibernateException {		if ( object == null ) {			return null;		}		else {			Serializable id = session.getEntityIdentifier(object);			if ( id==null ) {				if ( isTransient(entityName, object, Boolean.FALSE, session) ) {					throw new TransientObjectException(							"object references an unsaved transient instance - save the transient instance before flushing: " +							session.guessEntityName(object)					);				}				id = session.getEntityPersister(entityName, object).getIdentifier( object, session.getEntityMode() );			}			return id;		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线看国产日韩| 亚洲电影在线播放| 亚洲国产欧美另类丝袜| 国产在线精品国自产拍免费| 色视频欧美一区二区三区| 精品奇米国产一区二区三区| 亚洲卡通动漫在线| 国产69精品一区二区亚洲孕妇| 欧美日韩视频在线观看一区二区三区 | 亚洲va欧美va天堂v国产综合| 国产河南妇女毛片精品久久久| 欧美高清性hdvideosex| 亚洲乱码精品一二三四区日韩在线 | 欧美一区二区免费| 亚洲一区二区三区四区在线免费观看| 国产suv精品一区二区6| 欧美成人乱码一区二区三区| 午夜精品久久久久久久蜜桃app| 成人av电影在线| 国产亚洲欧美日韩俺去了| 精品亚洲国内自在自线福利| 欧美一区二区三区视频免费| 亚洲成人高清在线| 欧美三级中文字幕| 亚洲最新视频在线播放| 欧美性猛交xxxx黑人交| 亚洲综合久久久久| 欧美性欧美巨大黑白大战| 一区二区三区不卡视频在线观看 | 亚洲影院久久精品| 欧美午夜精品一区二区蜜桃| 亚洲一区在线看| 欧美色偷偷大香| 日韩二区在线观看| 欧美tickling网站挠脚心| 精油按摩中文字幕久久| 久久九九久精品国产免费直播| 国产另类ts人妖一区二区| 久久亚区不卡日本| 丁香六月综合激情| 中文字幕视频一区| 欧美亚洲动漫另类| 久久99国内精品| 国产欧美一区二区精品性色| jvid福利写真一区二区三区| 亚洲手机成人高清视频| 91麻豆精品国产91久久久久| 久久丁香综合五月国产三级网站| 亚洲精品一区在线观看| 丁香婷婷深情五月亚洲| 亚洲精品高清在线| 欧美一区二区福利视频| 国产.欧美.日韩| 国产精品国产馆在线真实露脸| 色哟哟国产精品| 日本成人中文字幕| 国产亚洲精品aa午夜观看| 99精品在线免费| 免费成人在线影院| 国产精品久久久久久久裸模 | 成人免费看视频| 亚洲一区二区在线播放相泽| 日韩视频国产视频| www.一区二区| 麻豆精品一区二区三区| 中文字幕av不卡| 91精品婷婷国产综合久久竹菊| 国产高清视频一区| 亚洲无线码一区二区三区| 久久免费视频色| 欧美日韩国产另类一区| 成人短视频下载| 日本欧美肥老太交大片| 亚洲色图制服丝袜| 久久中文娱乐网| 欧美电影一区二区三区| 岛国精品在线播放| 久久福利视频一区二区| 一区二区三区产品免费精品久久75| 欧美变态口味重另类| 色综合一个色综合亚洲| 国产呦萝稀缺另类资源| 日韩经典一区二区| 亚洲激情在线播放| 国产精品欧美精品| 久久一夜天堂av一区二区三区 | 蜜桃视频第一区免费观看| 亚洲精品国产无套在线观| 久久新电视剧免费观看| 51精品秘密在线观看| 色88888久久久久久影院按摩| 国模套图日韩精品一区二区| 日本不卡高清视频| 亚洲国产一区二区在线播放| 国产精品福利一区二区三区| 国产亚洲欧美一区在线观看| 精品日本一线二线三线不卡| 欧美精品久久久久久久多人混战| 北岛玲一区二区三区四区| 国产成人综合自拍| 韩国欧美国产一区| 九九九久久久精品| 极品销魂美女一区二区三区| 日韩成人av影视| 日韩不卡一二三区| 日韩av二区在线播放| 亚洲1区2区3区视频| 亚洲一区二区三区视频在线播放 | 国产精品的网站| 中文成人综合网| 国产精品久久久久精k8| 中文字幕一区二区视频| 亚洲天堂2016| 一区二区高清免费观看影视大全 | 亚洲九九爱视频| 国产欧美日韩卡一| 国产精品沙发午睡系列990531| 亚洲国产高清aⅴ视频| 中文字幕一区二区三区乱码在线| 国产精品久久久久久妇女6080 | 国产免费观看久久| 1区2区3区精品视频| 亚洲欧美偷拍卡通变态| 亚洲一区欧美一区| 首页国产欧美日韩丝袜| 免费成人结看片| 国产福利精品一区| 99热在这里有精品免费| 欧美色精品天天在线观看视频| 欧美日韩国产精品成人| 精品少妇一区二区三区免费观看| 2022国产精品视频| 国产精品国产三级国产| 亚洲电影在线免费观看| 精品中文字幕一区二区| 成人黄色一级视频| 欧美久久一二区| 精品国产三级电影在线观看| 国产精品久久久久一区二区三区共 | 亚洲18色成人| 国产精品一区一区三区| 97久久超碰国产精品电影| 欧美另类久久久品| 国产欧美精品一区aⅴ影院 | 韩国女主播一区二区三区| 不卡影院免费观看| 欧美老年两性高潮| 精品国产乱码久久久久久牛牛| 国产精品天干天干在线综合| 亚洲综合一区二区精品导航| 久久国产精品无码网站| 91久久人澡人人添人人爽欧美| 欧美精品777| 亚洲国产精品成人综合| 亚洲成人在线免费| 国产高清不卡二三区| 欧美精品在欧美一区二区少妇| 国产亚洲欧美一级| 青青国产91久久久久久 | 日韩三级av在线播放| 国产精品成人一区二区艾草| 奇米四色…亚洲| 欧美中文字幕一区| 国产精品白丝在线| 久久不见久久见免费视频1 | 成人av电影在线网| 欧美tickling网站挠脚心| 亚洲伦理在线精品| www..com久久爱| 久久久美女艺术照精彩视频福利播放| 亚洲一区二区精品久久av| 成人免费高清在线| 久久久91精品国产一区二区三区| 亚洲一区二区三区小说| 91视频观看视频| 亚洲国产精品高清| 国产专区欧美精品| 欧美岛国在线观看| 日韩影院精彩在线| 欧美撒尿777hd撒尿| 亚洲精品大片www| 99精品久久久久久| 自拍偷拍亚洲欧美日韩| 成人av网站免费| 国产日本欧洲亚洲| 国产乱色国产精品免费视频| 日韩欧美中文字幕精品| 亚洲大片精品永久免费| 欧美性videosxxxxx| 亚洲精品乱码久久久久久| 色综合天天在线| 亚洲精品日日夜夜| 在线观看视频一区二区| 亚洲精品久久久蜜桃| 日本韩国欧美三级| 亚洲午夜私人影院| 欧美日韩1234| 日本欧美加勒比视频| 日韩欧美123| 国内精品伊人久久久久影院对白|