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

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

?? localsessionfactorybean.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
						config.setCacheConcurrencyStrategy(className, strategyAndRegion[0]);
					}
				}
			}

			if (this.collectionCacheStrategies != null) {
				// Register cache strategies for mapped collections.
				for (Enumeration collRoles = this.collectionCacheStrategies.propertyNames(); collRoles.hasMoreElements();) {
					String collRole = (String) collRoles.nextElement();
					String[] strategyAndRegion =
							StringUtils.commaDelimitedListToStringArray(this.collectionCacheStrategies.getProperty(collRole));
					if (strategyAndRegion.length > 1) {
						config.setCollectionCacheConcurrencyStrategy(collRole, strategyAndRegion[0], strategyAndRegion[1]);
					}
					else if (strategyAndRegion.length > 0) {
						config.setCollectionCacheConcurrencyStrategy(collRole, strategyAndRegion[0]);
					}
				}
			}

			if (this.eventListeners != null) {
				// Register specified Hibernate event listeners.
				for (Iterator it = this.eventListeners.entrySet().iterator(); it.hasNext();) {
					Map.Entry entry = (Map.Entry) it.next();
					Assert.isTrue(entry.getKey() instanceof String, "Event listener key needs to be of type String");
					String listenerType = (String) entry.getKey();
					Object listenerObject = entry.getValue();
					if (listenerObject instanceof Collection) {
						Collection listeners = (Collection) listenerObject;
						EventListeners listenerRegistry = config.getEventListeners();
						Object[] listenerArray =
								(Object[]) Array.newInstance(listenerRegistry.getListenerClassFor(listenerType), listeners.size());
						listenerArray = listeners.toArray(listenerArray);
						config.setListeners(listenerType, listenerArray);
					}
					else {
						config.setListener(listenerType, listenerObject);
					}
				}
			}

			// Perform custom post-processing in subclasses.
			postProcessConfiguration(config);

			// Build SessionFactory instance.
			logger.info("Building new Hibernate SessionFactory");
			this.configuration = config;
			return newSessionFactory(config);
		}

		finally {
			if (dataSource != null) {
				// Reset DataSource holder.
				configTimeDataSourceHolder.set(null);
			}
			if (this.jtaTransactionManager != null) {
				// Reset TransactionManager holder.
				configTimeTransactionManagerHolder.set(null);
			}
			if (this.cacheProvider != null) {
				// Reset CacheProvider holder.
				configTimeCacheProviderHolder.set(null);
			}
			if (this.lobHandler != null) {
				// Reset LobHandler holder.
				configTimeLobHandlerHolder.set(null);
			}
			if (overrideClassLoader) {
				// Reset original thread context ClassLoader.
				currentThread.setContextClassLoader(threadContextClassLoader);
			}
		}
	}

	/**
	 * Subclasses can override this method to perform custom initialization
	 * of the Configuration instance used for SessionFactory creation.
	 * The properties of this LocalSessionFactoryBean will be applied to
	 * the Configuration object that gets returned here.
	 * <p>The default implementation creates a new Configuration instance.
	 * A custom implementation could prepare the instance in a specific way,
	 * or use a custom Configuration subclass.
	 * @return the Configuration instance
	 * @throws HibernateException in case of Hibernate initialization errors
	 * @see org.hibernate.cfg.Configuration#Configuration()
	 */
	protected Configuration newConfiguration() throws HibernateException {
		return (Configuration) BeanUtils.instantiateClass(this.configurationClass);
	}

	/**
	 * To be implemented by subclasses that want to to register further mappings
	 * on the Configuration object after this FactoryBean registered its specified
	 * mappings.
	 * <p>Invoked <i>before</i> the <code>Configuration.buildMappings()</code> call,
	 * so that it can still extend and modify the mapping information.
	 * @param config the current Configuration object
	 * @throws HibernateException in case of Hibernate initialization errors
	 * @see org.hibernate.cfg.Configuration#buildMappings()
	 */
	protected void postProcessMappings(Configuration config) throws HibernateException {
	}

	/**
	 * To be implemented by subclasses that want to to perform custom
	 * post-processing of the Configuration object after this FactoryBean
	 * performed its default initialization.
	 * <p>Invoked <i>after</i> the <code>Configuration.buildMappings()</code> call,
	 * so that it can operate on the completed and fully parsed mapping information.
	 * @param config the current Configuration object
	 * @throws HibernateException in case of Hibernate initialization errors
	 * @see org.hibernate.cfg.Configuration#buildMappings()
	 */
	protected void postProcessConfiguration(Configuration config) throws HibernateException {
	}

	/**
	 * Subclasses can override this method to perform custom initialization
	 * of the SessionFactory instance, creating it via the given Configuration
	 * object that got prepared by this LocalSessionFactoryBean.
	 * <p>The default implementation invokes Configuration's buildSessionFactory.
	 * A custom implementation could prepare the instance in a specific way,
	 * or use a custom SessionFactoryImpl subclass.
	 * @param config Configuration prepared by this LocalSessionFactoryBean
	 * @return the SessionFactory instance
	 * @throws HibernateException in case of Hibernate initialization errors
	 * @see org.hibernate.cfg.Configuration#buildSessionFactory
	 */
	protected SessionFactory newSessionFactory(Configuration config) throws HibernateException {
		return config.buildSessionFactory();
	}

	/**
	 * Return the Configuration object used to build the SessionFactory.
	 * Allows access to configuration metadata stored there (rarely needed).
	 * @throws IllegalStateException if the Configuration object has not been initialized yet
	 */
	public final Configuration getConfiguration() {
		if (this.configuration == null) {
			throw new IllegalStateException("Configuration not initialized yet");
		}
		return this.configuration;
	}

	/**
	 * Executes schema update if requested.
	 * @see #setSchemaUpdate
	 * @see #updateDatabaseSchema()
	 */
	protected void afterSessionFactoryCreation() throws Exception {
		if (this.schemaUpdate) {
			DataSource dataSource = getDataSource();
			if (dataSource != null) {
				// Make given DataSource available for the schema update,
				// which unfortunately reinstantiates a ConnectionProvider.
				configTimeDataSourceHolder.set(dataSource);
			}
			try {
				updateDatabaseSchema();
			}
			finally {
				if (dataSource != null) {
					// Reset DataSource holder.
					configTimeDataSourceHolder.set(null);
				}
			}
		}
	}

	/**
	 * Allows for schema export on shutdown.
	 */
	public void destroy() throws HibernateException {
		DataSource dataSource = getDataSource();
		if (dataSource != null) {
			// Make given DataSource available for potential SchemaExport,
			// which unfortunately reinstantiates a ConnectionProvider.
			configTimeDataSourceHolder.set(dataSource);
		}
		try {
			super.destroy();
		}
		finally {
			if (dataSource != null) {
				// Reset DataSource holder.
				configTimeDataSourceHolder.set(null);
			}
		}
	}


	/**
	 * Execute schema drop script, determined by the Configuration object
	 * used for creating the SessionFactory. A replacement for Hibernate's
	 * SchemaExport class, to be invoked on application setup.
	 * <p>Fetch the LocalSessionFactoryBean itself rather than the exposed
	 * SessionFactory to be able to invoke this method, e.g. via
	 * <code>LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");</code>.
	 * <p>Uses the SessionFactory that this bean generates for accessing a JDBC
	 * connection to perform the script.
	 * @throws org.springframework.dao.DataAccessException in case of script execution errors
	 * @see org.hibernate.cfg.Configuration#generateDropSchemaScript
	 * @see org.hibernate.tool.hbm2ddl.SchemaExport#drop
	 */
	public void dropDatabaseSchema() throws DataAccessException {
		logger.info("Dropping database schema for Hibernate SessionFactory");
		HibernateTemplate hibernateTemplate = new HibernateTemplate(getSessionFactory());
		hibernateTemplate.execute(
			new HibernateCallback() {
				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Connection con = session.connection();
					Dialect dialect = Dialect.getDialect(getConfiguration().getProperties());
					String[] sql = getConfiguration().generateDropSchemaScript(dialect);
					executeSchemaScript(con, sql);
					return null;
				}
			}
		);
	}

	/**
	 * Execute schema creation script, determined by the Configuration object
	 * used for creating the SessionFactory. A replacement for Hibernate's
	 * SchemaExport class, to be invoked on application setup.
	 * <p>Fetch the LocalSessionFactoryBean itself rather than the exposed
	 * SessionFactory to be able to invoke this method, e.g. via
	 * <code>LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");</code>.
	 * <p>Uses the SessionFactory that this bean generates for accessing a JDBC
	 * connection to perform the script.
	 * @throws DataAccessException in case of script execution errors
	 * @see org.hibernate.cfg.Configuration#generateSchemaCreationScript
	 * @see org.hibernate.tool.hbm2ddl.SchemaExport#create
	 */
	public void createDatabaseSchema() throws DataAccessException {
		logger.info("Creating database schema for Hibernate SessionFactory");
		HibernateTemplate hibernateTemplate = new HibernateTemplate(getSessionFactory());
		hibernateTemplate.execute(
			new HibernateCallback() {
				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Connection con = session.connection();
					Dialect dialect = Dialect.getDialect(getConfiguration().getProperties());
					String[] sql = getConfiguration().generateSchemaCreationScript(dialect);
					executeSchemaScript(con, sql);
					return null;
				}
			}
		);
	}

	/**
	 * Execute schema update script, determined by the Configuration object
	 * used for creating the SessionFactory. A replacement for Hibernate's
	 * SchemaUpdate class, for automatically executing schema update scripts
	 * on application startup. Can also be invoked manually.
	 * <p>Fetch the LocalSessionFactoryBean itself rather than the exposed
	 * SessionFactory to be able to invoke this method, e.g. via
	 * <code>LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");</code>.
	 * <p>Uses the SessionFactory that this bean generates for accessing a JDBC
	 * connection to perform the script.
	 * @throws DataAccessException in case of script execution errors
	 * @see #setSchemaUpdate
	 * @see org.hibernate.cfg.Configuration#generateSchemaUpdateScript
	 * @see org.hibernate.tool.hbm2ddl.SchemaUpdate
	 */
	public void updateDatabaseSchema() throws DataAccessException {
		logger.info("Updating database schema for Hibernate SessionFactory");
		HibernateTemplate hibernateTemplate = new HibernateTemplate(getSessionFactory());
		hibernateTemplate.setFlushMode(HibernateTemplate.FLUSH_NEVER);
		hibernateTemplate.execute(
			new HibernateCallback() {
				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Connection con = session.connection();
					Dialect dialect = Dialect.getDialect(getConfiguration().getProperties());
					DatabaseMetadata metadata = new DatabaseMetadata(con, dialect);
					String[] sql = getConfiguration().generateSchemaUpdateScript(dialect, metadata);
					executeSchemaScript(con, sql);
					return null;
				}
			}
		);
	}

	/**
	 * Execute the given schema script on the given JDBC Connection.
	 * <p>Note that the default implementation will log unsuccessful statements
	 * and continue to execute. Override the <code>executeSchemaStatement</code>
	 * method to treat failures differently.
	 * @param con the JDBC Connection to execute the script on
	 * @param sql the SQL statements to execute
	 * @throws SQLException if thrown by JDBC methods
	 * @see #executeSchemaStatement
	 */
	protected void executeSchemaScript(Connection con, String[] sql) throws SQLException {
		if (sql != null && sql.length > 0) {
			boolean oldAutoCommit = con.getAutoCommit();
			if (!oldAutoCommit) {
				con.setAutoCommit(true);
			}
			try {
				Statement stmt = con.createStatement();
				try {
					for (int i = 0; i < sql.length; i++) {
						executeSchemaStatement(stmt, sql[i]);
					}
				}
				finally {
					JdbcUtils.closeStatement(stmt);
				}
			}
			finally {
				if (!oldAutoCommit) {
					con.setAutoCommit(false);
				}
			}
		}
	}

	/**
	 * Execute the given schema SQL on the given JDBC Statement.
	 * <p>Note that the default implementation will log unsuccessful statements
	 * and continue to execute. Override this method to treat failures differently.
	 * @param stmt the JDBC Statement to execute the SQL on
	 * @param sql the SQL statement to execute
	 * @throws SQLException if thrown by JDBC methods (and considered fatal)
	 */
	protected void executeSchemaStatement(Statement stmt, String sql) throws SQLException {
		if (logger.isDebugEnabled()) {
			logger.debug("Executing schema statement: " + sql);
		}
		try {
			stmt.executeUpdate(sql);
		}
		catch (SQLException ex) {
			if (logger.isWarnEnabled()) {
				logger.warn("Unsuccessful schema statement: " + sql, ex);
			}
		}
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区国产盗摄色噜噜| 91亚洲精品久久久蜜桃| 成人动漫精品一区二区| 欧美三级韩国三级日本三斤| 久久久久九九视频| 午夜不卡av在线| 91麻豆国产在线观看| 久久免费偷拍视频| 日本不卡的三区四区五区| 成人av网站免费| 国产日韩亚洲欧美综合| 秋霞电影网一区二区| 欧美午夜精品免费| 亚洲女同女同女同女同女同69| 国产东北露脸精品视频| 日韩欧美高清一区| 视频一区二区三区入口| 在线视频综合导航| 亚洲另类春色国产| 成人免费的视频| 日本一区二区三区dvd视频在线| 日韩国产欧美三级| 欧美性xxxxx极品少妇| 亚洲男人的天堂网| 99精品热视频| 国产精品久久久久久久裸模| 国产精品一级在线| 久久精品一区二区| 紧缚捆绑精品一区二区| 国产精品丝袜一区| 国产夫妻精品视频| 中文字幕av一区二区三区免费看| 国产乱码精品一区二区三区av | 欧美日韩亚洲不卡| 一区二区三区成人| 欧美熟乱第一页| 五月天丁香久久| 欧美成人艳星乳罩| 国产精品亚洲一区二区三区妖精| 久久久久久久综合日本| 高清在线不卡av| 亚洲欧美偷拍另类a∨色屁股| 色综合色综合色综合色综合色综合| 国产精品视频yy9299一区| gogogo免费视频观看亚洲一| 亚洲三级在线观看| 欧美日韩久久一区| 久热成人在线视频| 国产午夜精品理论片a级大结局| 成人免费av网站| 亚洲国产一区二区视频| 欧美成人r级一区二区三区| 久久精品国产亚洲高清剧情介绍| 国产欧美日韩综合精品一区二区| 成人国产在线观看| 亚洲成av人片在线观看| 久久综合色婷婷| 99re成人在线| 秋霞午夜鲁丝一区二区老狼| 中文文精品字幕一区二区| 色婷婷av一区二区三区gif | 亚洲国产aⅴ成人精品无吗| 91麻豆精品国产91久久久久久| 精品一区二区三区视频| 亚洲欧美日韩在线播放| 日韩免费在线观看| 99国产精品国产精品久久| 首页亚洲欧美制服丝腿| 国产丝袜欧美中文另类| 色丁香久综合在线久综合在线观看| 日本免费新一区视频| 自拍偷在线精品自拍偷无码专区| 欧美日韩国产高清一区二区三区| 91视频精品在这里| 国模套图日韩精品一区二区| 一区二区在线观看av| 2021中文字幕一区亚洲| 在线观看成人免费视频| 东方欧美亚洲色图在线| 美女在线视频一区| 亚洲精品va在线观看| 久久久www成人免费毛片麻豆| 日本国产一区二区| 国产成人福利片| 美女视频网站黄色亚洲| 亚洲一区二区3| 最近日韩中文字幕| 国产午夜亚洲精品羞羞网站| 制服丝袜国产精品| 色一情一伦一子一伦一区| 懂色中文一区二区在线播放| 蜜桃视频在线一区| 天堂在线一区二区| 亚洲美女视频一区| 国产精品美女久久久久高潮| 久久精品综合网| 欧美成人aa大片| 欧美一级精品大片| 在线播放亚洲一区| 欧美亚洲综合在线| 欧美中文字幕亚洲一区二区va在线 | 欧美成人一区二区三区片免费 | 日本精品视频一区二区三区| 粗大黑人巨茎大战欧美成人| 国产在线播放一区| 蜜桃av一区二区三区| 奇米四色…亚洲| 天堂av在线一区| 日韩国产在线一| 日韩精品一级二级 | 欧美一区二区精美| 欧美美女一区二区三区| 欧美日韩国产大片| 91精品午夜视频| 日韩女优制服丝袜电影| 欧美成人激情免费网| 久久综合丝袜日本网| 国产欧美综合在线观看第十页| 久久久久国色av免费看影院| 国产亚洲一区二区三区四区 | 最近日韩中文字幕| 国产精品视频九色porn| 日韩美女啊v在线免费观看| 亚洲三级在线观看| 亚洲一级二级三级在线免费观看| 性感美女极品91精品| 男女激情视频一区| 久久爱另类一区二区小说| 久久国产精品免费| 国产精品99精品久久免费| 99国产精品99久久久久久| 在线一区二区视频| 日韩一区二区中文字幕| 久久嫩草精品久久久精品| 国产精品盗摄一区二区三区| 亚洲精品视频观看| 日韩精品色哟哟| 国产精品18久久久久久久久| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久国产精品99久久久久久老狼| 另类小说一区二区三区| 国产成人夜色高潮福利影视| 色哟哟日韩精品| 日韩欧美精品在线视频| 国产精品热久久久久夜色精品三区 | 日本aⅴ免费视频一区二区三区| 美女视频黄久久| 91在线免费播放| 欧美大尺度电影在线| 亚洲日本一区二区| 麻豆精品蜜桃视频网站| 91视视频在线直接观看在线看网页在线看 | 久久99精品久久久| 91在线无精精品入口| 日韩一区和二区| 一二三四区精品视频| 国产精品一区二区无线| 欧美酷刑日本凌虐凌虐| 国产精品成人网| 麻豆视频观看网址久久| 色综合视频在线观看| 国产亚洲污的网站| 亚洲成av人片在线| 99国产精品99久久久久久| 久久综合五月天婷婷伊人| 亚洲不卡在线观看| 色综合天天综合网天天狠天天 | 91精品国产一区二区三区蜜臀| 欧美国产精品一区二区三区| 免费观看日韩av| 在线区一区二视频| 国产精品初高中害羞小美女文| 精品一区二区三区视频| 91精品国产91久久久久久一区二区 | 亚洲电影在线播放| 成人激情av网| 久久综合狠狠综合久久激情| 免费看欧美美女黄的网站| 欧美日韩一区二区三区不卡 | 色av成人天堂桃色av| 欧美激情一区二区三区蜜桃视频| 久热成人在线视频| 日韩亚洲欧美成人一区| 成人一二三区视频| 久久久久久久久岛国免费| 精品一区二区三区免费观看| 日韩精品一区二区三区四区视频 | 26uuu国产在线精品一区二区| 亚洲国产一区在线观看| 欧美亚一区二区| 亚洲男同1069视频| 91麻豆免费视频| 亚洲欧美国产毛片在线| 色综合久久六月婷婷中文字幕| 中文字幕一区在线观看视频| 成人深夜视频在线观看| 国产精品麻豆欧美日韩ww| eeuss国产一区二区三区| 中文在线资源观看网站视频免费不卡 | 在线免费观看日韩欧美|