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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? configuration.java

?? 介紹了hibernate的入門有一些基本常用的事例
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
//$Id: Configuration.java,v 1.67 2005/04/08 16:39:43 steveebersole Exp $package org.hibernate.cfg;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.ObjectInputStream;import java.io.Serializable;import java.io.StringReader;import java.net.URL;import java.util.ArrayList;import java.util.Enumeration;import java.util.HashMap;import java.util.HashSet;import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.Properties;import java.util.Set;import java.util.TreeMap;import java.util.Map.Entry;import java.util.jar.JarFile;import java.util.zip.ZipEntry;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.dom4j.Attribute;import org.dom4j.Element;import org.hibernate.EntityMode;import org.hibernate.HibernateException;import org.hibernate.Interceptor;import org.hibernate.MappingException;import org.hibernate.SessionFactory;import org.hibernate.Transaction;import org.hibernate.dialect.Dialect;import org.hibernate.dialect.MySQLDialect;import org.hibernate.engine.FilterDefinition;import org.hibernate.engine.Mapping;import org.hibernate.event.AutoFlushEventListener;import org.hibernate.event.PersistEventListener;import org.hibernate.event.DeleteEventListener;import org.hibernate.event.DirtyCheckEventListener;import org.hibernate.event.EvictEventListener;import org.hibernate.event.FlushEntityEventListener;import org.hibernate.event.FlushEventListener;import org.hibernate.event.InitializeCollectionEventListener;import org.hibernate.event.LoadEventListener;import org.hibernate.event.LockEventListener;import org.hibernate.event.MergeEventListener;import org.hibernate.event.PostDeleteEventListener;import org.hibernate.event.PostInsertEventListener;import org.hibernate.event.PostLoadEventListener;import org.hibernate.event.PostUpdateEventListener;import org.hibernate.event.PreDeleteEventListener;import org.hibernate.event.PreInsertEventListener;import org.hibernate.event.PreLoadEventListener;import org.hibernate.event.PreUpdateEventListener;import org.hibernate.event.RefreshEventListener;import org.hibernate.event.ReplicateEventListener;import org.hibernate.event.SaveOrUpdateEventListener;import org.hibernate.event.SessionEventListenerConfig;import org.hibernate.id.IdentifierGenerator;import org.hibernate.id.PersistentIdentifierGenerator;import org.hibernate.impl.SessionFactoryImpl;import org.hibernate.mapping.Collection;import org.hibernate.mapping.ForeignKey;import org.hibernate.mapping.IdentifierCollection;import org.hibernate.mapping.Index;import org.hibernate.mapping.PersistentClass;import org.hibernate.mapping.Property;import org.hibernate.mapping.RootClass;import org.hibernate.mapping.SimpleValue;import org.hibernate.mapping.Table;import org.hibernate.mapping.UniqueKey;import org.hibernate.secure.JACCConfiguration;import org.hibernate.tool.hbm2ddl.DatabaseMetadata;import org.hibernate.tool.hbm2ddl.TableMetadata;import org.hibernate.type.SerializationException;import org.hibernate.type.Type;import org.hibernate.util.ArrayHelper;import org.hibernate.util.CollectionHelper;import org.hibernate.util.SerializationHelper;import org.hibernate.util.XMLHelper;import org.hibernate.util.ReflectHelper;import org.w3c.dom.Document;import org.xml.sax.EntityResolver;import org.xml.sax.InputSource;/** * An instance of <tt>Configuration</tt> allows the application * to specify properties and mapping documents to be used when * creating a <tt>SessionFactory</tt>. Usually an application will create * a single <tt>Configuration</tt>, build a single instance of * <tt>SessionFactory</tt> and then instantiate <tt>Session</tt>s in * threads servicing client requests. The <tt>Configuration</tt> is meant * only as an initialization-time object. <tt>SessionFactory</tt>s are * immutable and do not retain any association back to the * <tt>Configuration</tt>.<br> * <br> * A new <tt>Configuration</tt> will use the properties specified in * <tt>hibernate.properties</tt> by default. * * @author Gavin King * @see org.hibernate.SessionFactory */public class Configuration implements Serializable {	private static Log log = LogFactory.getLog( Configuration.class );	protected Map classes;	protected Map imports;	protected Map collections;	protected Map tables;	protected Map namedQueries;	protected Map namedSqlQueries;	protected Map filterDefinitions;	protected List secondPasses;	protected List propertyReferences;	protected Map extendsQueue; // key: classname -> value: dom4j document	private Interceptor interceptor;	private Properties properties;	private EntityResolver entityResolver;	private transient XMLHelper xmlHelper;	protected transient Map typeDefs;	protected NamingStrategy namingStrategy = DefaultNamingStrategy.INSTANCE;	private SessionEventListenerConfig sessionEventListenerConfig;	private final SettingsFactory settingsFactory;	protected void reset() {		classes = new HashMap();		imports = new HashMap();		collections = new HashMap();		tables = new TreeMap();		namedQueries = new HashMap();		namedSqlQueries = new HashMap();		xmlHelper = new XMLHelper();		typeDefs = new HashMap();		propertyReferences = new ArrayList();		secondPasses = new ArrayList();		interceptor = EMPTY_INTERCEPTOR;		properties = Environment.getProperties();		entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER;		sessionEventListenerConfig = new SessionEventListenerConfig();		filterDefinitions = new HashMap();		extendsQueue = new HashMap();	}	private transient Mapping mapping = buildMapping();	protected Configuration(SettingsFactory settingsFactory) {		this.settingsFactory = settingsFactory;		reset();	}	public Configuration() {		this( new SettingsFactory() );	}	/**	 * Iterate the class mappings	 */	public Iterator getClassMappings() {		return classes.values().iterator();	}	/**	 * Iterate the collection mappings	 */	public Iterator getCollectionMappings() {		return collections.values().iterator();	}	/**	 * Iterate the table mappings	 */	public Iterator getTableMappings() {		return tables.values().iterator();	}	/**	 * Get the mapping for a particular class	 */	public PersistentClass getClassMapping(String persistentClass) {		return ( PersistentClass ) classes.get( persistentClass );	}	/**	 * Get the mapping for a particular collection role	 *	 * @param role a collection role	 * @return Collection	 */	public Collection getCollectionMapping(String role) {		return ( Collection ) collections.get( role );	}	/**	 * Set a custom entity resolver. This entity resolver must be	 * set before addXXX(misc) call.	 * Default value is {@link org.hibernate.util.DTDEntityResolver}	 *	 * @param entityResolver entity resolver to use	 */	public void setEntityResolver(EntityResolver entityResolver) {		this.entityResolver = entityResolver;	}	/**	 * Read mappings from a particular XML file	 *	 * @param xmlFile a path to a file	 */	public Configuration addFile(String xmlFile) throws MappingException {		log.info( "Mapping file: " + xmlFile );		try {			List errors = new ArrayList();			org.dom4j.Document doc = xmlHelper.createSAXReader( xmlFile, errors, entityResolver ).read( new File( xmlFile ) );			if ( errors.size() != 0 ) throw new MappingException( "invalid mapping", ( Throwable ) errors.get( 0 ) );			add( doc );			return this;		}		catch ( Exception e ) {			log.error( "Could not configure datastore from file: " + xmlFile, e );			throw new MappingException( "Could not configure datastore from file: " + xmlFile, e );		}	}	/**	 * Read mappings from a particular XML file	 *	 * @param xmlFile a path to a file	 */	public Configuration addFile(File xmlFile) throws MappingException {		log.info( "Mapping file: " + xmlFile.getPath() );		try {			addInputStream( new FileInputStream( xmlFile ) );		}		catch ( Exception e ) {			log.error( "Could not configure datastore from file: " + xmlFile.getPath(), e );			throw new MappingException( "Could not configure datastore from file: " + xmlFile.getPath(), e );		}		return this;	}	/**	 * If a cached <tt>xmlFile + ".bin"</tt> exists and is newer than <tt>xmlFile</tt> the	 * <tt>".bin"</tt> file will be read directly. Otherwise xmlFile is read and then	 * serialized to <tt>xmlFile + ".bin"</tt> for use the next time.	 */	public Configuration addCacheableFile(File xmlFile) throws MappingException {		try {			File lazyfile = new File( xmlFile.getAbsolutePath() + ".bin" );			org.dom4j.Document doc = null;			List errors = new ArrayList();			final boolean useCachedFile = xmlFile.exists() &&					lazyfile.exists() &&					xmlFile.lastModified() < lazyfile.lastModified();			if ( useCachedFile ) {				try {					log.info( "Mapping cached file: " + lazyfile );					doc = ( org.dom4j.Document ) SerializationHelper.deserialize( new FileInputStream( lazyfile ) );				}				catch ( SerializationException e ) {					log.warn( "Could not deserialize cached file: " + lazyfile.getPath(), e );				}			}			// If deserialization failed			if ( doc == null ) {				doc = xmlHelper.createSAXReader( xmlFile.getAbsolutePath(), errors, entityResolver ).read( xmlFile );				try {					log.info( "Writing cached file of " + xmlFile + " to " + lazyfile );					SerializationHelper.serialize( ( Serializable ) doc, new FileOutputStream( lazyfile ) );				}				catch ( SerializationException e ) {					log.warn( "Could not write cached file: " + lazyfile, e );				}			}			if ( errors.size() != 0 ) throw new MappingException( "invalid mapping", ( Throwable ) errors.get( 0 ) );			add( doc );			return this;		}		catch ( Exception e ) {			log.error( "Could not configure datastore from file: " + xmlFile, e );			throw new MappingException( e );		}	}	public Configuration addCacheableFile(String xmlFile) throws MappingException {		return addCacheableFile( new File( xmlFile ) );	}	/**	 * Read mappings from a <tt>String</tt>	 *	 * @param xml an XML string	 */	public Configuration addXML(String xml) throws MappingException {		if ( log.isDebugEnabled() ) log.debug( "Mapping XML:\n" + xml );		try {			List errors = new ArrayList();			org.dom4j.Document doc = xmlHelper.createSAXReader( "XML String", errors, entityResolver ).read( new StringReader( xml ) );			if ( errors.size() != 0 ) throw new MappingException( "invalid mapping", ( Throwable ) errors.get( 0 ) );			add( doc );		}		catch ( Exception e ) {			log.error( "Could not configure datastore from XML", e );			throw new MappingException( e );		}		return this;	}	/**	 * Read mappings from a <tt>URL</tt>	 *	 * @param url	 */	public Configuration addURL(URL url) throws MappingException {		if ( log.isDebugEnabled() ) log.debug( "Mapping URL:\n" + url );		try {			addInputStream( url.openStream() );		}		catch ( Exception e ) {			log.error( "Could not configure datastore from URL: " + url , e );			throw new MappingException( "Could not configure datastore from URL: " + url, e );		}		return this;	}	/**	 * Read mappings from a DOM <tt>Document</tt>	 *	 * @param doc a DOM document	 */	public Configuration addDocument(Document doc) throws MappingException {		if ( log.isDebugEnabled() ) log.debug( "Mapping XML:\n" + doc );		try {			add( xmlHelper.createDOMReader().read( doc ) );		}		catch ( Exception e ) {			log.error( "Could not configure datastore from XML document", e );			throw new MappingException( e );		}		return this;	}	protected void add(org.dom4j.Document doc) throws MappingException {		try {			HbmBinder.bindRoot( doc, createMappings(), CollectionHelper.EMPTY_MAP ); // TODO: possibly get inheritable meta's from cfg.xml		}		catch ( MappingException me ) {			log.error( "Could not compile the mapping document", me );			throw me;		}	}	/**	 * Create a new <tt>Mappings</tt> to add class and collection	 * mappings to.	 */	public Mappings createMappings() {		return new Mappings( classes,				collections,				tables,				namedQueries,				namedSqlQueries,				imports,				secondPasses,				propertyReferences,				namingStrategy,				typeDefs,				filterDefinitions,				extendsQueue );	}	/**	 * Read mappings from an <tt>InputStream</tt>	 *	 * @param xmlInputStream an <tt>InputStream</tt> containing XML	 */	public Configuration addInputStream(InputStream xmlInputStream) throws MappingException {		try {			List errors = new ArrayList();			org.dom4j.Document doc = xmlHelper.createSAXReader( "XML InputStream", errors, entityResolver ).read( new InputSource( xmlInputStream ) );			if ( errors.size() != 0 ) throw new MappingException( "invalid mapping", ( Throwable ) errors.get( 0 ) );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人aaaa| 欧美日韩在线观看一区二区| 99国产欧美另类久久久精品| 色噜噜狠狠色综合中国| 日韩欧美中文字幕一区| 成人免费小视频| 麻豆精品国产91久久久久久| jizzjizzjizz欧美| 精品久久久久久久久久久久久久久久久| 综合久久久久综合| 寂寞少妇一区二区三区| 欧美色图片你懂的| 亚洲欧洲av色图| 国产一区二区三区免费播放| 欧美精品在线观看播放| 亚洲色图色小说| 国产真实精品久久二三区| 色狠狠av一区二区三区| 久久这里只有精品6| 一级中文字幕一区二区| 国产精选一区二区三区| 欧美午夜在线观看| 中文乱码免费一区二区| 日韩av一级片| 在线观看日产精品| 欧美国产综合一区二区| 日本欧美肥老太交大片| 欧美一区二区在线观看| 在线播放一区二区三区| 国产精品入口麻豆九色| 亚洲第一会所有码转帖| 国产1区2区3区精品美女| 欧美一区二区在线免费观看| 亚洲一区二区视频在线观看| 成人综合日日夜夜| 日韩精品资源二区在线| 亚洲综合久久久| 99久久免费国产| 国产亚洲成av人在线观看导航| 日韩中文欧美在线| 欧美在线不卡一区| 亚洲欧美一区二区三区国产精品| 国产一区二区三区高清播放| 91麻豆精品国产91久久久久久久久| 亚洲欧美日韩中文播放| www.亚洲人| 欧美极品aⅴ影院| 精品亚洲国内自在自线福利| 欧美精品久久一区二区三区| 亚洲va欧美va人人爽午夜| 91福利视频网站| 亚洲欧美日韩小说| 色久综合一二码| 一区二区三区不卡在线观看| 91色乱码一区二区三区| 亚洲欧洲韩国日本视频| 成人av综合一区| 国产精品乱码久久久久久| 蜜桃精品视频在线观看| 欧美激情中文字幕一区二区| 久久精品国产精品青草| 久久久久久久久久久久久久久99 | 亚洲高清不卡在线观看| 色综合中文综合网| 国产婷婷色一区二区三区四区| 黄色日韩网站视频| 精品国免费一区二区三区| 久久99久久99小草精品免视看| 日韩亚洲欧美高清| 国产永久精品大片wwwapp| 久久九九全国免费| 成人18视频在线播放| 亚洲色图清纯唯美| 欧美丰满高潮xxxx喷水动漫| 免费欧美日韩国产三级电影| 亚洲精品一区二区在线观看| 国产精品69毛片高清亚洲| 国产精品女上位| 色天天综合色天天久久| 亚洲成人激情自拍| 精品久久久久久久久久久久包黑料 | 1区2区3区欧美| 欧美日韩一区二区在线观看视频 | 91精品午夜视频| 经典三级一区二区| 国产午夜精品在线观看| 国产成人免费视频网站| 亚洲色图欧美激情| 91精品国产综合久久久久久漫画| 韩日精品视频一区| 综合久久久久久| 欧美一级片在线观看| 成人免费高清视频| 亚洲国产精品一区二区久久| 日韩情涩欧美日韩视频| 99视频在线观看一区三区| 免费三级欧美电影| 国产精品护士白丝一区av| 欧美日韩激情在线| 国产精品一区二区果冻传媒| 亚洲一区二区影院| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日本国产视频| 成人丝袜18视频在线观看| 香蕉乱码成人久久天堂爱免费| 久久伊人中文字幕| 欧美日韩一区二区三区免费看 | 东方欧美亚洲色图在线| 亚洲伦理在线精品| 欧美区一区二区三区| 理论电影国产精品| 亚洲精选视频免费看| 欧美成人高清电影在线| 色噜噜狠狠色综合欧洲selulu| 国产精品一区免费视频| 日韩av一级片| 亚洲高清免费观看 | gogogo免费视频观看亚洲一| 亚洲成人自拍一区| 国产人成亚洲第一网站在线播放| 欧美午夜精品一区| 99re这里只有精品首页| 美女网站色91| 亚洲va中文字幕| 国产亲近乱来精品视频| 3d动漫精品啪啪一区二区竹菊| 91在线观看免费视频| 丰满亚洲少妇av| 国产在线国偷精品产拍免费yy| 日韩在线观看一区二区| 亚洲电影在线免费观看| 亚洲精品va在线观看| 一区在线观看免费| 中文字幕精品三区| 国产欧美日韩在线观看| 久久久久国色av免费看影院| 欧美精品一区二区高清在线观看 | 亚洲精品网站在线观看| 国产精品毛片无遮挡高清| 国产午夜亚洲精品羞羞网站| 久久香蕉国产线看观看99| 欧美精品一区二区久久久| 久久久精品日韩欧美| 久久久精品中文字幕麻豆发布| 久久精品视频在线看| 国产婷婷色一区二区三区| 国产欧美视频一区二区| 欧美国产精品一区二区三区| 欧美韩日一区二区三区四区| 中文字幕免费观看一区| 国产精品色在线观看| 最新久久zyz资源站| 亚洲免费在线视频一区 二区| 亚洲丝袜自拍清纯另类| 亚洲午夜免费视频| 视频精品一区二区| 免费观看日韩电影| 国内精品免费**视频| 成人免费视频caoporn| 99精品黄色片免费大全| 欧美伊人久久久久久久久影院| 欧美美女激情18p| 日韩一区二区三区电影在线观看 | 成人免费视频视频在线观看免费 | 波波电影院一区二区三区| 99re热视频精品| 欧美亚洲综合在线| 精品久久免费看| 中文字幕亚洲一区二区av在线| 亚洲综合在线免费观看| 青青国产91久久久久久| 国产风韵犹存在线视精品| 色av成人天堂桃色av| 欧美一级免费观看| 国产精品狼人久久影院观看方式| 亚洲免费av观看| 久久电影网电视剧免费观看| va亚洲va日韩不卡在线观看| 91精品在线观看入口| 国产精品久久久久影院老司 | 亚洲高清久久久| 国产精品原创巨作av| 欧美日韩在线播放三区四区| 久久久久久一二三区| 一区二区在线观看不卡| 美腿丝袜亚洲三区| 91在线观看美女| 欧美videofree性高清杂交| 18成人在线观看| 久久国产精品无码网站| 91福利在线免费观看| 久久久国产午夜精品 | 国产乱色国产精品免费视频| 91福利国产成人精品照片| 久久久久久久久久久久电影| 视频一区视频二区中文字幕| 99久久综合99久久综合网站| 日韩欧美国产一区在线观看| 亚洲已满18点击进入久久| 福利一区福利二区|