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

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

?? localsessionfactorybean.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * Copyright 2002-2007 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.toplink;

import java.sql.SQLException;

import oracle.toplink.exceptions.DatabaseException;
import oracle.toplink.exceptions.TopLinkException;

import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.support.PersistenceExceptionTranslator;
import org.springframework.jdbc.support.SQLExceptionTranslator;

/**
 * {@link org.springframework.beans.factory.FactoryBean} that creates a
 * TopLink {@link SessionFactory}. This is the usual way to set up a shared
 * TopLink SessionFactory in a Spring application context; the SessionFactory
 * can then be passed to TopLink-based DAOs via dependency injection.
 *
 * <p>See the base class {@link LocalSessionFactory} for configuration details.
 *
 * <p>This class also implements the
 * {@link org.springframework.dao.support.PersistenceExceptionTranslator}
 * interface, as autodetected by Spring's
 * {@link org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor},
 * for AOP-based translation of native exceptions to Spring DataAccessExceptions.
 * Hence, the presence of a LocalSessionFactoryBean automatically enables a
 * PersistenceExceptionTranslationPostProcessor to translate TopLink exceptions.
 *
 * <p>If your DAOs expect to receive a raw TopLink Session, consider defining a
 * {@link org.springframework.orm.toplink.support.TransactionAwareSessionAdapter}
 * in front of this bean. This adapter will provide a TopLink Session rather
 * than a SessionFactory as bean reference. Your DAOs can then, for example,
 * access the currently active Session and UnitOfWork via
 * <code>Session.getActiveSession()</code> and <code>Session.getActiveUnitOfWork()</code>,
 * respectively. Note that you can still access the SessionFactory as well, by
 * defining a bean reference that points directly at the LocalSessionFactoryBean.
 *
 * @author Juergen Hoeller
 * @since 1.2
 * @see LocalSessionFactory
 * @see org.springframework.orm.toplink.support.TransactionAwareSessionAdapter
 * @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
 */
public class LocalSessionFactoryBean extends LocalSessionFactory
		implements FactoryBean, BeanClassLoaderAware, InitializingBean, DisposableBean, PersistenceExceptionTranslator {

	private SessionFactory sessionFactory;

	private SQLExceptionTranslator jdbcExceptionTranslator;


	/**
	 * Set the JDBC exception translator for this SessionFactory.
	 * <p>Applied to any SQLException root cause of a TopLink DatabaseException,
	 * within Spring's PersistenceExceptionTranslator mechanism.
	 * The default is to rely on TopLink's native exception translation.
	 * @see oracle.toplink.exceptions.DatabaseException
	 * @see org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
	 * @see org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
	 */
	public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator) {
		this.jdbcExceptionTranslator = jdbcExceptionTranslator;
	}

	/**
	 * Return the JDBC exception translator for this instance, if any.
	 */
	public SQLExceptionTranslator getJdbcExceptionTranslator() {
		return this.jdbcExceptionTranslator;
	}

	/**
	 * Sets the given bean ClassLoader as TopLink Session ClassLoader.
	 * @see #setSessionClassLoader
	 */
	public void setBeanClassLoader(ClassLoader classLoader) {
		setSessionClassLoader(classLoader);
	}

	public void afterPropertiesSet() throws TopLinkException {
		this.sessionFactory = createSessionFactory();
	}


	public Object getObject() {
		return this.sessionFactory;
	}

	public Class getObjectType() {
		return (this.sessionFactory != null ? this.sessionFactory.getClass() : SessionFactory.class);
	}

	public boolean isSingleton() {
		return true;
	}


	/**
	 * Implementation of the PersistenceExceptionTranslator interface,
	 * as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
	 * <p>Converts the exception if it is a TopLinkException;
	 * else returns <code>null</code> to indicate an unknown exception.
	 * @see org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
	 * @see #convertTopLinkAccessException
	 */
	public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
		if (ex instanceof TopLinkException) {
			return convertTopLinkAccessException((TopLinkException) ex);
		}
		return null;
	}

	/**
	 * Convert the given TopLinkException to an appropriate exception from the
	 * <code>org.springframework.dao</code> hierarchy.
	 * <p>Will automatically apply a specified SQLExceptionTranslator to a
	 * TopLink DatabaseException, else rely on TopLink's default translation.
	 * @param ex TopLinkException that occured
	 * @return a corresponding DataAccessException
	 * @see SessionFactoryUtils#convertTopLinkAccessException
	 * @see #setJdbcExceptionTranslator
	 */
	public DataAccessException convertTopLinkAccessException(TopLinkException ex) {
		if (getJdbcExceptionTranslator() != null && ex instanceof DatabaseException) {
			Throwable internalEx = ex.getInternalException();
			// Should always be a SQLException inside a DatabaseException.
			if (internalEx instanceof SQLException) {
				return getJdbcExceptionTranslator().translate(
						"TopLink operation: " + ex.getMessage(), null, (SQLException) internalEx);
			}
		}
		return SessionFactoryUtils.convertTopLinkAccessException(ex);
	}


	public void destroy() {
		logger.info("Closing TopLink SessionFactory");
		this.sessionFactory.close();
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
洋洋av久久久久久久一区| 欧美一二三四在线| 精品一区二区三区免费播放| 亚洲欧洲精品天堂一级| 欧美高清你懂得| 99久久综合99久久综合网站| 日产欧产美韩系列久久99| 国产精品电影院| 久久蜜桃一区二区| 欧美日韩黄色一区二区| 成人aa视频在线观看| 麻豆国产精品一区二区三区 | 亚洲激情第一区| 337p粉嫩大胆噜噜噜噜噜91av| 欧美中文字幕一区二区三区亚洲| 国产成人一区在线| 蜜臀久久99精品久久久久久9 | 欧美大片一区二区三区| 在线观看免费一区| 成人av在线影院| 国产精品一区一区| 免费观看日韩电影| 性感美女久久精品| 中文字幕一区在线观看视频| 久久久蜜桃精品| 日韩女优电影在线观看| 欧美日韩成人综合在线一区二区| 色综合久久六月婷婷中文字幕| 国产米奇在线777精品观看| 日产精品久久久久久久性色| 亚洲444eee在线观看| 亚洲自拍另类综合| 日韩美女久久久| 国产精品欧美极品| 国产亚洲一区二区三区| 久久视频一区二区| 亚洲精品一线二线三线| 91精品国产综合久久久久久| 欧美日韩精品欧美日韩精品一| 欧美性猛交xxxx乱大交退制版| 91成人免费网站| 在线观看91视频| 在线观看91视频| 欧美日韩中文字幕一区二区| 欧美三级中文字幕| 欧美挠脚心视频网站| 欧美日韩在线三级| 欧美精品在线观看一区二区| 91麻豆精品国产无毒不卡在线观看 | 亚洲精品一二三| 一区二区三区波多野结衣在线观看 | 色综合久久88色综合天天免费| 99精品国产99久久久久久白柏| 91免费看片在线观看| 色天使色偷偷av一区二区| 97国产一区二区| 在线观看日韩精品| 在线不卡欧美精品一区二区三区| 欧美精品久久久久久久久老牛影院| 91精品欧美一区二区三区综合在 | 久久国产精品99久久久久久老狼| 久久精品国产精品亚洲红杏| 国产一区二区在线免费观看| 粉嫩嫩av羞羞动漫久久久| 99国产精品一区| 欧美久久一区二区| 久久综合久久鬼色中文字| 国产精品污www在线观看| 国产精品福利在线播放| 亚洲二区在线视频| 裸体歌舞表演一区二区| 成人综合日日夜夜| 欧美主播一区二区三区| 精品国产123| 中文字幕一区二区在线观看| 亚洲国产乱码最新视频| 狠狠色综合色综合网络| 91麻豆.com| 欧美一卡二卡在线观看| 国产精品视频看| 亚洲va欧美va天堂v国产综合| 久久精品国产999大香线蕉| 91网站最新网址| 91精品国产aⅴ一区二区| 国产日韩成人精品| 亚洲成av人在线观看| 国产精品综合久久| 欧美色爱综合网| 国产精品毛片久久久久久| 亚洲chinese男男1069| 成人福利视频网站| 日韩视频123| 一区二区三区在线影院| 国产综合色精品一区二区三区| 欧美性淫爽ww久久久久无| 久久嫩草精品久久久久| 日韩精品一级中文字幕精品视频免费观看 | 久99久精品视频免费观看| av在线这里只有精品| 亚洲精品一区二区三区影院| 一区二区三区国产| 国产高清精品久久久久| 欧美乱妇15p| 欧美一级生活片| 亚洲欧美一区二区视频| 免费人成精品欧美精品| 麻豆精品在线播放| 欧美日韩一区中文字幕| 国产亚洲一区二区三区| 日韩影院免费视频| 91在线porny国产在线看| 欧美一激情一区二区三区| 亚洲精品视频在线看| 韩国一区二区在线观看| 91福利在线观看| 国产日本亚洲高清| 日韩高清不卡一区二区| av在线不卡电影| 亚洲国产精品高清| 美女精品一区二区| 日本韩国欧美在线| 久久久99精品久久| 日韩影院在线观看| 日本高清不卡aⅴ免费网站| 精品国产乱码久久久久久牛牛| 夜夜嗨av一区二区三区| 成人夜色视频网站在线观看| 2021国产精品久久精品| 日韩国产欧美在线播放| 欧美视频在线播放| 中文字幕一区二区在线观看 | 日韩成人免费看| 色综合一区二区三区| 国产日韩v精品一区二区| 美国精品在线观看| 欧美日韩一级大片网址| 亚洲国产成人av好男人在线观看| 高清不卡一区二区| 久久欧美一区二区| 久久99最新地址| 日韩欧美激情四射| 精品亚洲免费视频| 日韩欧美一区二区久久婷婷| 午夜天堂影视香蕉久久| 欧美性极品少妇| 亚洲一区免费在线观看| 精品一区二区三区久久久| 26uuu亚洲| 精品一区二区成人精品| 日韩欧美国产电影| 久久国产夜色精品鲁鲁99| 欧美一区二区三区视频免费| 天天综合网天天综合色| 色呦呦国产精品| 伊人性伊人情综合网| 91九色最新地址| 亚洲免费在线电影| 91极品美女在线| 午夜激情一区二区三区| 777亚洲妇女| 一区二区三区不卡视频 | 91久久人澡人人添人人爽欧美| 中文字幕一区日韩精品欧美| 91免费在线看| 亚洲高清久久久| 欧美一二三区在线| 成人黄色网址在线观看| 中文字幕亚洲一区二区av在线| 色综合中文综合网| 精品在线播放免费| 久久免费午夜影院| 成人动漫一区二区| 一区二区三区四区在线播放| 制服丝袜日韩国产| 极品少妇xxxx偷拍精品少妇| 国产女主播在线一区二区| 9i在线看片成人免费| 国产精品另类一区| 欧美酷刑日本凌虐凌虐| 紧缚捆绑精品一区二区| 中文字幕不卡的av| 欧美三级韩国三级日本一级| 国产一区二区三区美女| 中文字幕一区三区| 欧美夫妻性生活| 国产原创一区二区三区| 中文字幕+乱码+中文字幕一区| 91欧美一区二区| 免费看欧美美女黄的网站| 久久久www成人免费无遮挡大片| 欧美综合天天夜夜久久| 久久99九九99精品| 成人欧美一区二区三区黑人麻豆| 精品视频一区三区九区| 成人一级视频在线观看| 性做久久久久久| 国产精品福利一区| 日韩欧美黄色影院| 欧美日韩一卡二卡| 成人精品视频一区二区三区尤物|