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

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

?? localsessionfactorybean.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
 * Copyright 2002-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.orm.hibernate3;

import java.io.File;
import java.lang.reflect.Array;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;

import javax.sql.DataSource;
import javax.transaction.TransactionManager;

import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cache.CacheProvider;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.Mappings;
import org.hibernate.cfg.NamingStrategy;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.FilterDefinition;
import org.hibernate.event.EventListeners;
import org.hibernate.tool.hbm2ddl.DatabaseMetadata;
import org.hibernate.transaction.JTATransactionFactory;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
import org.springframework.jdbc.support.JdbcUtils;
import org.springframework.jdbc.support.lob.LobHandler;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;

/**
 * {@link org.springframework.beans.factory.FactoryBean} that creates a
 * Hibernate {@link org.hibernate.SessionFactory}. This is the usual way to
 * set up a shared Hibernate SessionFactory in a Spring application context;
 * the SessionFactory can then be passed to Hibernate-based DAOs via
 * dependency injection.
 *
 * <p>Configuration settings can either be read from a Hibernate XML file,
 * specified as "configLocation", or completely via this class. A typical
 * local configuration consists of one or more "mappingResources", various
 * "hibernateProperties" (not strictly necessary), and a "dataSource" that the
 * SessionFactory should use. The latter can also be specified via Hibernate
 * properties, but "dataSource" supports any Spring-configured DataSource,
 * instead of relying on Hibernate's own connection providers.
 *
 * <p>This SessionFactory handling strategy is appropriate for most types of
 * applications, from Hibernate-only single database apps to ones that need
 * distributed transactions. Either {@link HibernateTransactionManager} or
 * {@link org.springframework.transaction.jta.JtaTransactionManager} can be
 * used for transaction demarcation, with the latter only necessary for
 * transactions which span multiple databases.
 *
 * <p>This factory bean will by default expose a transaction-aware SessionFactory
 * proxy, letting data access code work with the plain Hibernate SessionFactory
 * and its <code>getCurrentSession()</code> method, while still being able to
 * participate in current Spring-managed transactions: with any transaction
 * management strategy, either local or JTA / EJB CMT, and any transaction
 * synchronization mechanism, either Spring or JTA. Furthermore,
 * <code>getCurrentSession()</code> will also seamlessly work with
 * a request-scoped Session managed by
 * {@link org.springframework.orm.hibernate3.support.OpenSessionInViewFilter} /
 * {@link org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor}.
 *
 * <p><b>Requires Hibernate 3.1 or later.</b> Note that this factory will use
 * "on_close" as default Hibernate connection release mode, unless in the
 * case of a "jtaTransactionManager" specified, for the reason that
 * this is appropriate for most Spring-based applications (in particular when
 * using Spring's HibernateTransactionManager). Hibernate 3.0 used "on_close"
 * as its own default too; however, Hibernate 3.1 changed this to "auto"
 * (i.e. "after_statement" or "after_transaction").
 *
 * @author Juergen Hoeller
 * @since 1.2
 * @see HibernateTemplate#setSessionFactory
 * @see HibernateTransactionManager#setSessionFactory
 * @see #setExposeTransactionAwareSessionFactory
 * @see #setJtaTransactionManager
 * @see org.hibernate.SessionFactory#getCurrentSession()
 * @see HibernateTransactionManager
 */
public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implements BeanClassLoaderAware {

	private static final ThreadLocal configTimeDataSourceHolder = new ThreadLocal();

	private static final ThreadLocal configTimeTransactionManagerHolder = new ThreadLocal();

	private static final ThreadLocal configTimeCacheProviderHolder = new ThreadLocal();

	private static final ThreadLocal configTimeLobHandlerHolder = new ThreadLocal();

	/**
	 * Return the DataSource for the currently configured Hibernate SessionFactory,
	 * to be used by LocalDataSourceConnectionProvoder.
	 * <p>This instance will be set before initialization of the corresponding
	 * SessionFactory, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setDataSource
	 * @see LocalDataSourceConnectionProvider
	 */
	public static DataSource getConfigTimeDataSource() {
		return (DataSource) configTimeDataSourceHolder.get();
	}

	/**
	 * Return the JTA TransactionManager for the currently configured Hibernate
	 * SessionFactory, to be used by LocalTransactionManagerLookup.
	 * <p>This instance will be set before initialization of the corresponding
	 * SessionFactory, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setJtaTransactionManager
	 * @see LocalTransactionManagerLookup
	 */
	public static TransactionManager getConfigTimeTransactionManager() {
		return (TransactionManager) configTimeTransactionManagerHolder.get();
	}

	/**
	 * Return the CacheProvider for the currently configured Hibernate SessionFactory,
	 * to be used by LocalCacheProviderProxy.
	 * <p>This instance will be set before initialization of the corresponding
	 * SessionFactory, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setCacheProvider
	 */
	public static CacheProvider getConfigTimeCacheProvider() {
		return (CacheProvider) configTimeCacheProviderHolder.get();
	}

	/**
	 * Return the LobHandler for the currently configured Hibernate SessionFactory,
	 * to be used by UserType implementations like ClobStringType.
	 * <p>This instance will be set before initialization of the corresponding
	 * SessionFactory, and reset immediately afterwards. It is thus only available
	 * during configuration.
	 * @see #setLobHandler
	 * @see org.springframework.orm.hibernate3.support.ClobStringType
	 * @see org.springframework.orm.hibernate3.support.BlobByteArrayType
	 * @see org.springframework.orm.hibernate3.support.BlobSerializableType
	 */
	public static LobHandler getConfigTimeLobHandler() {
		return (LobHandler) configTimeLobHandlerHolder.get();
	}


	private Class configurationClass = Configuration.class;

	private Resource[] configLocations;

	private String[] mappingResources;

	private Resource[] mappingLocations;

	private Resource[] cacheableMappingLocations;

	private Resource[] mappingJarLocations;

	private Resource[] mappingDirectoryLocations;

	private Properties hibernateProperties;

	private TransactionManager jtaTransactionManager;

	private CacheProvider cacheProvider;

	private LobHandler lobHandler;

	private Interceptor entityInterceptor;

	private NamingStrategy namingStrategy;

	private TypeDefinitionBean[] typeDefinitions;

	private FilterDefinition[] filterDefinitions;

	private Properties entityCacheStrategies;

	private Properties collectionCacheStrategies;

	private Map eventListeners;

	private boolean schemaUpdate = false;

	private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();

	private Configuration configuration;


	/**
	 * Specify the Hibernate Configuration class to use.
	 * Default is "org.hibernate.cfg.Configuration"; any subclass of
	 * this default Hibernate Configuration class can be specified.
	 * <p>Can be set to "org.hibernate.cfg.AnnotationConfiguration" for
	 * using Hibernate3 annotation support (initially only available as
	 * alpha download separate from the main Hibernate3 distribution).
	 * <p>Annotated packages and annotated classes can be specified via the
	 * corresponding tags in "hibernate.cfg.xml" then, so this will usually
	 * be combined with a "configLocation" property that points at such a
	 * standard Hibernate configuration file.
	 * @see #setConfigLocation
	 * @see org.hibernate.cfg.Configuration
	 * @see org.hibernate.cfg.AnnotationConfiguration
	 */
	public void setConfigurationClass(Class configurationClass) {
		if (configurationClass == null || !Configuration.class.isAssignableFrom(configurationClass)) {
			throw new IllegalArgumentException(
					"configurationClass must be assignable to [org.hibernate.cfg.Configuration]");
		}
		this.configurationClass = configurationClass;
	}

	/**
	 * Set the location of a single Hibernate XML config file, for example as
	 * classpath resource "classpath:hibernate.cfg.xml".
	 * <p>Note: Can be omitted when all necessary properties and mapping
	 * resources are specified locally via this bean.
	 * @see org.hibernate.cfg.Configuration#configure(java.net.URL)
	 */
	public void setConfigLocation(Resource configLocation) {
		this.configLocations = new Resource[] {configLocation};
	}

	/**
	 * Set the locations of multiple Hibernate XML config files, for example as
	 * classpath resources "classpath:hibernate.cfg.xml,classpath:extension.cfg.xml".
	 * <p>Note: Can be omitted when all necessary properties and mapping
	 * resources are specified locally via this bean.
	 * @see org.hibernate.cfg.Configuration#configure(java.net.URL)
	 */
	public void setConfigLocations(Resource[] configLocations) {
		this.configLocations = configLocations;
	}

	/**
	 * Set Hibernate mapping resources to be found in the class path,
	 * like "example.hbm.xml" or "mypackage/example.hbm.xml".
	 * Analogous to mapping entries in a Hibernate XML config file.
	 * Alternative to the more generic setMappingLocations method.
	 * <p>Can be used to add to mappings from a Hibernate XML config file,
	 * or to specify all mappings locally.
	 * @see #setMappingLocations
	 * @see org.hibernate.cfg.Configuration#addResource
	 */
	public void setMappingResources(String[] mappingResources) {
		this.mappingResources = mappingResources;
	}

	/**
	 * Set locations of Hibernate mapping files, for example as classpath
	 * resource "classpath:example.hbm.xml". Supports any resource location
	 * via Spring's resource abstraction, for example relative paths like
	 * "WEB-INF/mappings/example.hbm.xml" when running in an application context.
	 * <p>Can be used to add to mappings from a Hibernate XML config file,
	 * or to specify all mappings locally.
	 * @see org.hibernate.cfg.Configuration#addInputStream
	 */
	public void setMappingLocations(Resource[] mappingLocations) {
		this.mappingLocations = mappingLocations;
	}

	/**
	 * Set locations of cacheable Hibernate mapping files, for example as web app
	 * resource "/WEB-INF/mapping/example.hbm.xml". Supports any resource location
	 * via Spring's resource abstraction, as long as the resource can be resolved
	 * in the file system.
	 * <p>Can be used to add to mappings from a Hibernate XML config file,
	 * or to specify all mappings locally.
	 * @see org.hibernate.cfg.Configuration#addCacheableFile(java.io.File)
	 */
	public void setCacheableMappingLocations(Resource[] cacheableMappingLocations) {
		this.cacheableMappingLocations = cacheableMappingLocations;
	}

	/**
	 * Set locations of jar files that contain Hibernate mapping resources,
	 * like "WEB-INF/lib/example.hbm.jar".
	 * <p>Can be used to add to mappings from a Hibernate XML config file,
	 * or to specify all mappings locally.
	 * @see org.hibernate.cfg.Configuration#addJar(java.io.File)
	 */
	public void setMappingJarLocations(Resource[] mappingJarLocations) {
		this.mappingJarLocations = mappingJarLocations;
	}

	/**
	 * Set locations of directories that contain Hibernate mapping resources,
	 * like "WEB-INF/mappings".
	 * <p>Can be used to add to mappings from a Hibernate XML config file,
	 * or to specify all mappings locally.
	 * @see org.hibernate.cfg.Configuration#addDirectory(java.io.File)
	 */
	public void setMappingDirectoryLocations(Resource[] mappingDirectoryLocations) {
		this.mappingDirectoryLocations = mappingDirectoryLocations;
	}

	/**
	 * Set Hibernate properties, such as "hibernate.dialect".
	 * <p>Can be used to override values in a Hibernate XML config file,
	 * or to specify all necessary properties locally.
	 * <p>Note: Do not specify a transaction provider here when using
	 * Spring-driven transactions. It is also advisable to omit connection
	 * provider settings and use a Spring-set DataSource instead.
	 * @see #setDataSource
	 */
	public void setHibernateProperties(Properties hibernateProperties) {
		this.hibernateProperties = hibernateProperties;
	}

	/**
	 * Return the Hibernate properties, if any. Mainly available for
	 * configuration through property paths that specify individual keys.
	 */
	public Properties getHibernateProperties() {
		if (this.hibernateProperties == null) {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品婷婷国产综合久久| 91激情在线视频| 视频一区免费在线观看| 亚洲素人一区二区| 亚洲嫩草精品久久| 亚洲精品国产a| 亚洲午夜一区二区三区| 亚洲综合色在线| 亚洲一区二区在线免费观看视频| 中文字幕一区二区三| 国产精品情趣视频| 日韩毛片精品高清免费| 1024国产精品| 亚洲一区二区在线视频| 丝袜美腿成人在线| 狠狠v欧美v日韩v亚洲ⅴ| 久久成人久久爱| 成人激情校园春色| av电影在线观看完整版一区二区| jlzzjlzz欧美大全| 色综合夜色一区| 欧美日韩国产综合草草| 欧美一区2区视频在线观看| 欧美v日韩v国产v| 中国色在线观看另类| 成人欧美一区二区三区视频网页| 亚洲一区二区中文在线| 蜜臀久久久99精品久久久久久| 久久精品av麻豆的观看方式| 国产精品一二三四区| 在线日韩国产精品| 这里只有精品电影| 亚洲国产成人在线| 亚洲成国产人片在线观看| 九九视频精品免费| 成人黄色国产精品网站大全在线免费观看| 一本色道亚洲精品aⅴ| 欧美变态tickle挠乳网站| 国产精品免费丝袜| 奇米精品一区二区三区四区| 成人午夜精品在线| 欧美精品tushy高清| 国产日本亚洲高清| 首页国产欧美日韩丝袜| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 久久疯狂做爰流白浆xx| 9人人澡人人爽人人精品| 欧美高清一级片在线| 国产精品视频免费看| 美国十次综合导航| 一本色道a无线码一区v| 久久蜜桃一区二区| 性做久久久久久| 99精品桃花视频在线观看| 欧美一区二区三区视频免费播放| 日韩欧美成人一区二区| 亚洲一区免费视频| 99精品国产99久久久久久白柏| 欧美精品日韩综合在线| 亚洲人成网站在线| www.久久精品| 久久久噜噜噜久噜久久综合| 蜜桃精品视频在线| 欧美高清激情brazzers| 亚洲欧美偷拍卡通变态| 99久久久精品免费观看国产蜜| 精品成人在线观看| 日本亚洲免费观看| 色婷婷av一区二区三区gif| 国产精品美女久久久久久久久 | 久久久久久久久久久电影| 午夜av一区二区| 欧美日韩国产综合视频在线观看| 亚洲男人电影天堂| 色婷婷久久久亚洲一区二区三区| 最好看的中文字幕久久| a在线欧美一区| 国产精品欧美精品| 99精品欧美一区二区三区综合在线| 国产性做久久久久久| 国产成人午夜视频| 国产精品乱码一区二三区小蝌蚪| 国产精品中文有码| 国产日产欧美一区| 成人av影视在线观看| 日韩伦理av电影| 欧美在线观看视频一区二区 | 国产精品资源在线| 久久精品视频网| 成人av在线影院| 国产精品国产三级国产aⅴ中文| 国产不卡在线播放| 中文字幕一区二区在线观看| 91在线播放网址| 午夜影院久久久| 欧美电影免费观看完整版| 石原莉奈在线亚洲三区| 91精品欧美一区二区三区综合在| 久久精品国产**网站演员| 国产日韩v精品一区二区| 99国产精品久久久久久久久久久| 一区二区三区中文在线观看| 51午夜精品国产| 国产一区二区精品久久91| 国产精品国产三级国产普通话99| 在线观看91视频| 日韩精品亚洲一区二区三区免费| www亚洲一区| 色婷婷综合久久| 裸体一区二区三区| 国产精品国产三级国产普通话三级| 91污片在线观看| 久久国产精品色| 亚洲精品国产a久久久久久| 91麻豆精品国产91久久久久久久久| 美女脱光内衣内裤视频久久网站| 亚洲视频一区在线观看| 欧美日韩情趣电影| 国产精品影音先锋| 亚洲国产va精品久久久不卡综合| 久久众筹精品私拍模特| 色综合天天综合网天天看片| 久久99蜜桃精品| 亚洲制服丝袜一区| 国产日韩三级在线| 欧美日韩午夜在线视频| 不卡视频免费播放| 久久国产精品无码网站| 亚洲不卡在线观看| 国产精品欧美一区二区三区| 日韩欧美在线影院| 欧美狂野另类xxxxoooo| 91免费在线播放| 高清不卡在线观看av| 国产专区欧美精品| 捆绑变态av一区二区三区| 午夜欧美一区二区三区在线播放| 中文字幕在线免费不卡| 国产日本一区二区| 国产亚洲综合色| 精品剧情在线观看| 日韩欧美成人一区二区| 欧美精品黑人性xxxx| 欧美伦理电影网| 欧美在线视频全部完| 91福利区一区二区三区| 一本高清dvd不卡在线观看 | 制服.丝袜.亚洲.另类.中文| 色婷婷综合中文久久一本| 91麻豆国产福利精品| 懂色av一区二区三区免费观看| 激情久久久久久久久久久久久久久久| 日韩不卡一区二区| 亚洲va欧美va人人爽| 亚洲国产精品久久久久秋霞影院| 一区二区三区四区蜜桃| 亚洲欧美国产77777| 亚洲人成7777| 亚洲黄色免费网站| 亚洲成人一区在线| 秋霞成人午夜伦在线观看| 天天色综合成人网| 麻豆精品视频在线观看免费| 婷婷夜色潮精品综合在线| 奇米精品一区二区三区四区| 国内久久精品视频| 国产.欧美.日韩| 色狠狠色噜噜噜综合网| 欧美日韩视频专区在线播放| 欧美一区二区精品久久911| 精品99久久久久久| 国产精品美女久久久久久| 综合激情网...| 日本亚洲最大的色成网站www| 激情小说亚洲一区| 国产成人综合精品三级| 91亚洲大成网污www| 91 com成人网| 国产欧美精品在线观看| 亚洲天堂久久久久久久| 日韩不卡一区二区三区 | 亚洲蜜桃精久久久久久久| 亚洲一区二区免费视频| 久久99久久99精品免视看婷婷| 国产精一区二区三区| 在线国产电影不卡| 精品国产91久久久久久久妲己| 国产精品理伦片| 日本午夜精品视频在线观看| 国产乱码精品一区二区三区忘忧草 | 精品国产三级电影在线观看| 国产精品美女久久久久久久久| 亚洲午夜电影在线| 国产成人亚洲综合a∨猫咪| 欧美日高清视频| 久久精品在这里| 婷婷成人综合网| caoporn国产精品| 久久综合色之久久综合| 亚洲激情校园春色|