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

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

?? jpaaccessor.java

?? struts+spring 源碼 希望能給大家?guī)?lái)幫助
?? JAVA
字號(hào):
/*
 * Copyright 2002-2006 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.jpa;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceException;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.support.DataAccessUtils;

/**
 * Base class for JpaTemplate and JpaInterceptor, defining common
 * properties such as EntityManagerFactory and flushing behavior.
 *
 * <p>Not intended to be used directly. See JpaTemplate and JpaInterceptor.
 *
 * @author Juergen Hoeller
 * @since 2.0
 * @see #setEntityManagerFactory
 * @see #setEntityManager
 * @see #setJpaDialect
 * @see #setFlushEager
 * @see JpaTemplate
 * @see JpaInterceptor
 * @see JpaDialect
 */
public abstract class JpaAccessor extends EntityManagerFactoryAccessor implements InitializingBean {

	private EntityManager entityManager;

	private JpaDialect jpaDialect = new DefaultJpaDialect();

	private boolean flushEager = false;


	/**
	 * Set the JPA EntityManager to use.
	 */
	public void setEntityManager(EntityManager entityManager) {
		this.entityManager = entityManager;
	}

	/**
	 * Return the JPA EntityManager to use.
	 */
	public EntityManager getEntityManager() {
		return entityManager;
	}

	/**
	 * Set the JPA dialect to use for this accessor.
	 * <p>The dialect object can be used to retrieve the underlying JDBC
	 * connection, for example.
	 */
	public void setJpaDialect(JpaDialect jpaDialect) {
		this.jpaDialect = (jpaDialect != null ? jpaDialect : new DefaultJpaDialect());
	}

	/**
	 * Return the JPA dialect to use for this accessor.
	 * <p>Creates a default one for the specified EntityManagerFactory if none set.
	 */
	public JpaDialect getJpaDialect() {
		return this.jpaDialect;
	}

	/**
	 * Set if this accessor should flush changes to the database eagerly.
	 * <p>Eager flushing leads to immediate synchronization with the database,
	 * even if in a transaction. This causes inconsistencies to show up and throw
	 * a respective exception immediately, and JDBC access code that participates
	 * in the same transaction will see the changes as the database is already
	 * aware of them then. But the drawbacks are:
	 * <ul>
	 * <li>additional communication roundtrips with the database, instead of a
	 * single batch at transaction commit;
	 * <li>the fact that an actual database rollback is needed if the JPA
	 * transaction rolls back (due to already submitted SQL statements).
	 * </ul>
	 */
	public void setFlushEager(boolean flushEager) {
		this.flushEager = flushEager;
	}

	/**
	 * Return if this accessor should flush changes to the database eagerly.
	 */
	public boolean isFlushEager() {
		return flushEager;
	}

	/**
	 * Eagerly initialize the JPA dialect, creating a default one
	 * for the specified EntityManagerFactory if none set.
	 */
	public void afterPropertiesSet() {
		EntityManagerFactory emf = getEntityManagerFactory();
		if (emf == null && getEntityManager() == null) {
			throw new IllegalArgumentException("entityManagerFactory or entityManager is required");
		}
		if (emf instanceof EntityManagerFactoryInfo) {
			JpaDialect jpaDialect = ((EntityManagerFactoryInfo) emf).getJpaDialect();
			if (jpaDialect != null) {
				setJpaDialect(jpaDialect);
			}
		}
	}


	/**
	 * Flush the given JPA entity manager if necessary.
	 * @param em the current JPA PersistenceManage
	 * @param existingTransaction if executing within an existing transaction
	 * @throws javax.persistence.PersistenceException in case of JPA flushing errors
	 */
	protected void flushIfNecessary(EntityManager em, boolean existingTransaction) throws PersistenceException {
		if (isFlushEager()) {
			logger.debug("Eagerly flushing JPA entity manager");
			em.flush();
		}
	}

	/**
	 * Convert the given runtime exception to an appropriate exception from the
	 * <code>org.springframework.dao</code> hierarchy if necessary, or
	 * return the exception itself if it is not persistence related
	 * <p>Default implementation delegates to the JpaDialect.
	 * May be overridden in subclasses.
	 * @param ex runtime exception that occured, which may or may not
	 * be JPA-related
	 * @return the corresponding DataAccessException instance if
	 * wrapping should occur, otherwise the raw exception
	 * @see org.springframework.dao.support.DataAccessUtils#translateIfNecessary
	 */
	public RuntimeException translateIfNecessary(RuntimeException ex) {
		return DataAccessUtils.translateIfNecessary(ex, getJpaDialect());
	}

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久嫩草精品久久久精品一| 欧美午夜精品理论片a级按摩| 精品少妇一区二区三区日产乱码| 天天色天天操综合| 欧美一卡二卡在线| 美女在线视频一区| 国产香蕉久久精品综合网| 国产成人精品三级麻豆| 国产精品久久精品日日| 色婷婷国产精品| 午夜电影网亚洲视频| 精品国产乱码久久久久久老虎| 加勒比av一区二区| 亚洲欧洲日韩综合一区二区| 在线观看www91| 全国精品久久少妇| 日本一区二区三区四区| 色综合久久88色综合天天| 日韩综合在线视频| 国产欧美一区二区三区鸳鸯浴 | 五月天久久比比资源色| 日韩一区二区三区免费看| 国产精品资源在线看| 亚洲精品自拍动漫在线| 欧美一卡在线观看| 国产毛片一区二区| 亚洲综合清纯丝袜自拍| 日韩欧美国产精品一区| 成人精品免费看| 亚洲aⅴ怡春院| 国产日韩欧美综合在线| 91在线视频免费91| 美国一区二区三区在线播放| 亚洲欧洲一区二区在线播放| 欧美一区二区在线看| 国产mv日韩mv欧美| 日韩精品五月天| 中文字幕不卡在线观看| 精品久久久久香蕉网| 91香蕉视频在线| 久久爱www久久做| 亚洲免费av高清| 26uuu精品一区二区三区四区在线| k8久久久一区二区三区| 美女免费视频一区| 亚洲综合视频在线| 国产欧美中文在线| 欧美成人a∨高清免费观看| 色综合天天狠狠| 国产sm精品调教视频网站| 日本成人在线网站| 亚洲欧美一区二区三区极速播放| 欧美精品一区二区精品网| 在线观看亚洲精品| 9人人澡人人爽人人精品| 久久99国产精品久久99| 亚洲精品国久久99热| 国产欧美综合色| 精品国产髙清在线看国产毛片| 欧美在线制服丝袜| av亚洲精华国产精华精华| 国产精品1区2区| 久久99久久99小草精品免视看| 亚洲午夜视频在线| 亚洲综合色婷婷| 亚洲免费视频成人| 综合分类小说区另类春色亚洲小说欧美| 欧美电影免费观看完整版| 欧美日韩1区2区| 日本高清不卡一区| 91视频国产资源| jlzzjlzz欧美大全| 风间由美一区二区av101 | 精品一区二区三区久久| 亚洲成人自拍一区| 五月天网站亚洲| 亚洲国产欧美在线人成| 一区二区三区免费看视频| 国产精品乱码妇女bbbb| 国产色91在线| 国产精品麻豆一区二区| 综合久久久久久| 亚洲蜜臀av乱码久久精品 | 色悠悠久久综合| 91香蕉视频污| 一本色道a无线码一区v| 欧美在线高清视频| 欧美日韩一二三| 欧美日韩精品一区二区天天拍小说| 欧美亚一区二区| 精品视频在线看| 亚洲欧美日韩久久| 中文字幕在线一区免费| 亚洲三级电影网站| 亚洲一区二区三区美女| 爽爽淫人综合网网站| 开心九九激情九九欧美日韩精美视频电影| 日本不卡在线视频| 国产乱国产乱300精品| 国产成人综合网| 97超碰欧美中文字幕| 欧美无乱码久久久免费午夜一区| 精品视频1区2区3区| 日韩一区二区精品| 国产欧美日韩在线视频| 亚洲日本护士毛茸茸| 午夜在线电影亚洲一区| 久久精品国产久精国产爱| 粗大黑人巨茎大战欧美成人| 91麻豆swag| 欧美一区二区精品在线| 久久久精品免费观看| 又紧又大又爽精品一区二区| 日韩影院在线观看| 国产成人日日夜夜| 欧美性三三影院| 26uuu另类欧美亚洲曰本| 亚洲视频精选在线| 蜜桃av一区二区在线观看| 成人小视频在线| 欧美久久久久中文字幕| 久久久久久久综合色一本| 一区二区三区四区在线播放| 美女在线视频一区| 97久久精品人人做人人爽50路 | 一区二区三区免费| 奇米一区二区三区av| 成人av影院在线| 欧美精品一二三区| 国产精品伦理在线| 老司机精品视频导航| 日本丰满少妇一区二区三区| 精品久久人人做人人爰| 亚洲一级二级在线| 国产精品一级片在线观看| 欧美日韩在线播| 国产精品乱人伦中文| 韩国一区二区在线观看| 欧美日韩黄色一区二区| 国产精品色在线| 美国三级日本三级久久99| 在线免费观看日本一区| 久久女同互慰一区二区三区| 婷婷亚洲久悠悠色悠在线播放| 国产99久久久精品| 日韩欧美亚洲国产精品字幕久久久 | 欧美一区日韩一区| 一区二区不卡在线播放 | 国产高清视频一区| 欧美一区二区视频观看视频| 成人免费一区二区三区视频 | 国产精品亚洲专一区二区三区| 欧美日韩一区二区三区在线看| 国产精品久久久久久福利一牛影视| 激情图片小说一区| 91精品国产欧美日韩| 亚洲午夜一区二区三区| 色94色欧美sute亚洲线路二| 国产精品丝袜黑色高跟| 国产成人精品亚洲午夜麻豆| 精品国产免费久久| 久久国产夜色精品鲁鲁99| 欧美一级国产精品| 日韩成人一级大片| 69p69国产精品| 亚洲第一久久影院| 欧美日韩1区2区| 日韩专区一卡二卡| 91精品国产美女浴室洗澡无遮挡| 亚洲香蕉伊在人在线观| 欧美视频日韩视频| 亚洲一区二区综合| 欧美午夜片在线看| 亚洲成人av电影| 在线成人免费视频| 免费成人在线播放| 精品久久久三级丝袜| 国产激情视频一区二区在线观看| 久久久精品免费网站| 丰满放荡岳乱妇91ww| 中文字幕在线观看不卡| 91麻豆精东视频| 一区二区三区日韩精品| 欧美日韩免费电影| 奇米色一区二区三区四区| 日韩美女天天操| 国产精品一区二区男女羞羞无遮挡| 国产欧美一二三区| 91麻豆6部合集magnet| 无吗不卡中文字幕| www一区二区| 成人免费av资源| 亚洲午夜久久久久久久久久久| 欧美日韩国产免费| 精品制服美女丁香| 国产精品麻豆一区二区| 欧美日韩另类国产亚洲欧美一级| 久久er精品视频| 国产精品理论在线观看| 欧美日韩精品三区|