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

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

?? hibernatetemplate.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:

	/**
	 * Return the maximum number of rows specified for this HibernateTemplate.
	 */
	public int getMaxResults() {
		return this.maxResults;
	}


	public Object execute(HibernateCallback action) throws DataAccessException {
		return doExecute(action, false, false);
	}

	public List executeFind(HibernateCallback action) throws DataAccessException {
		Object result = doExecute(action, false, false);
		if (result != null && !(result instanceof List)) {
			throw new InvalidDataAccessApiUsageException(
					"Result object returned from HibernateCallback isn't a List: [" + result + "]");
		}
		return (List) result;
	}

	/**
	 * Execute the action specified by the given action object within a
	 * new {@link org.hibernate.Session}.
	 * <p>This execute variant overrides the template-wide
	 * {@link #isAlwaysUseNewSession() "alwaysUseNewSession"} setting.
	 * @param action callback object that specifies the Hibernate action
	 * @return a result object returned by the action, or <code>null</code>
	 * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
	 */
	public Object executeWithNewSession(HibernateCallback action) {
		return doExecute(action, true, false);
	}

	/**
	 * Execute the action specified by the given action object within a
	 * native {@link org.hibernate.Session}.
	 * <p>This execute variant overrides the template-wide
	 * {@link #isExposeNativeSession() "exposeNativeSession"} setting.
	 * @param action callback object that specifies the Hibernate action
	 * @return a result object returned by the action, or <code>null</code>
	 * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
	 */
	public Object executeWithNativeSession(HibernateCallback action) {
		return doExecute(action, false, true);
	}

	/**
	 * Execute the action specified by the given action object within a Session.
	 * @param action callback object that specifies the Hibernate action
	 * @param enforceNativeSession whether to enforce exposure of the native
	 * Hibernate Session to callback code
	 * @return a result object returned by the action, or <code>null</code>
	 * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
	 * @deprecated as of Spring 2.5, in favor of {@link #executeWithNativeSession}
	 */
	public Object execute(HibernateCallback action, boolean enforceNativeSession) throws DataAccessException {
		return doExecute(action, false, enforceNativeSession);
	}

	/**
	 * Execute the action specified by the given action object within a Session.
	 * @param action callback object that specifies the Hibernate action
	 * @param enforceNewSession whether to enforce a new Session for this template
	 * even if there is a pre-bound transactional Session
	 * @param enforceNativeSession whether to enforce exposure of the native
	 * Hibernate Session to callback code
	 * @return a result object returned by the action, or <code>null</code>
	 * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
	 */
	protected Object doExecute(HibernateCallback action, boolean enforceNewSession, boolean enforceNativeSession)
			throws DataAccessException {

		Assert.notNull(action, "Callback object must not be null");

		Session session = (enforceNewSession ?
				SessionFactoryUtils.getNewSession(getSessionFactory(), getEntityInterceptor()) : getSession());
		boolean existingTransaction = (!enforceNewSession &&
				(!isAllowCreate() || SessionFactoryUtils.isSessionTransactional(session, getSessionFactory())));
		if (existingTransaction) {
			logger.debug("Found thread-bound Session for HibernateTemplate");
		}

		FlushMode previousFlushMode = null;
		try {
			previousFlushMode = applyFlushMode(session, existingTransaction);
			enableFilters(session);
			Session sessionToExpose =
					(enforceNativeSession || isExposeNativeSession() ? session : createSessionProxy(session));
			Object result = action.doInHibernate(sessionToExpose);
			flushIfNecessary(session, existingTransaction);
			return result;
		}
		catch (HibernateException ex) {
			throw convertHibernateAccessException(ex);
		}
		catch (SQLException ex) {
			throw convertJdbcAccessException(ex);
		}
		catch (RuntimeException ex) {
			// Callback code threw application exception...
			throw ex;
		}
		finally {
			if (existingTransaction) {
				logger.debug("Not closing pre-bound Hibernate Session after HibernateTemplate");
				disableFilters(session);
				if (previousFlushMode != null) {
					session.setFlushMode(previousFlushMode);
				}
			}
			else {
				// Never use deferred close for an explicitly new Session.
				if (isAlwaysUseNewSession()) {
					SessionFactoryUtils.closeSession(session);
				}
				else {
					SessionFactoryUtils.closeSessionOrRegisterDeferredClose(session, getSessionFactory());
				}
			}
		}
	}

	/**
	 * Return a Session for use by this template.
	 * <p>Returns a new Session in case of "alwaysUseNewSession" (using the same
	 * JDBC Connection as a transactional Session, if applicable), a pre-bound
	 * Session in case of "allowCreate" turned off, and a pre-bound or new Session
	 * otherwise (new only if no transactional or otherwise pre-bound Session exists).
	 * @return the Session to use (never <code>null</code>)
	 * @see SessionFactoryUtils#getSession
	 * @see SessionFactoryUtils#getNewSession
	 * @see #setAlwaysUseNewSession
	 * @see #setAllowCreate
	 */
	protected Session getSession() {
		if (isAlwaysUseNewSession()) {
			return SessionFactoryUtils.getNewSession(getSessionFactory(), getEntityInterceptor());
		}
		else if (isAllowCreate()) {
			return SessionFactoryUtils.getSession(
					getSessionFactory(), getEntityInterceptor(), getJdbcExceptionTranslator());
		}
		else {
			try {
				return getSessionFactory().getCurrentSession();
			}
			catch (HibernateException ex) {
				throw new DataAccessResourceFailureException("Could not obtain current Hibernate Session", ex);
			}
		}
	}

	/**
	 * Create a close-suppressing proxy for the given Hibernate Session.
	 * The proxy also prepares returned Query and Criteria objects.
	 * @param session the Hibernate Session to create a proxy for
	 * @return the Session proxy
	 * @see org.hibernate.Session#close()
	 * @see #prepareQuery
	 * @see #prepareCriteria
	 */
	protected Session createSessionProxy(Session session) {
		Class[] sessionIfcs = null;
		Class mainIfc = (session instanceof org.hibernate.classic.Session ?
				org.hibernate.classic.Session.class : Session.class);
		if (session instanceof EventSource) {
			sessionIfcs = new Class[] {mainIfc, EventSource.class};
		}
		else if (session instanceof SessionImplementor) {
			sessionIfcs = new Class[] {mainIfc, SessionImplementor.class};
		}
		else {
			sessionIfcs = new Class[] {mainIfc};
		}
		return (Session) Proxy.newProxyInstance(
				getClass().getClassLoader(), sessionIfcs,
				new CloseSuppressingInvocationHandler(session));
	}


	//-------------------------------------------------------------------------
	// Convenience methods for loading individual objects
	//-------------------------------------------------------------------------

	public Object get(Class entityClass, Serializable id) throws DataAccessException {
		return get(entityClass, id, null);
	}

	public Object get(final Class entityClass, final Serializable id, final LockMode lockMode)
			throws DataAccessException {

		return executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				if (lockMode != null) {
					return session.get(entityClass, id, lockMode);
				}
				else {
					return session.get(entityClass, id);
				}
			}
		});
	}

	public Object get(String entityName, Serializable id) throws DataAccessException {
		return get(entityName, id, null);
	}

	public Object get(final String entityName, final Serializable id, final LockMode lockMode)
			throws DataAccessException {

		return executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				if (lockMode != null) {
					return session.get(entityName, id, lockMode);
				}
				else {
					return session.get(entityName, id);
				}
			}
		});
	}

	public Object load(Class entityClass, Serializable id) throws DataAccessException {
		return load(entityClass, id, null);
	}

	public Object load(final Class entityClass, final Serializable id, final LockMode lockMode)
			throws DataAccessException {

		return executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				if (lockMode != null) {
					return session.load(entityClass, id, lockMode);
				}
				else {
					return session.load(entityClass, id);
				}
			}
		});
	}

	public Object load(String entityName, Serializable id) throws DataAccessException {
		return load(entityName, id, null);
	}

	public Object load(final String entityName, final Serializable id, final LockMode lockMode)
			throws DataAccessException {

		return executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				if (lockMode != null) {
					return session.load(entityName, id, lockMode);
				}
				else {
					return session.load(entityName, id);
				}
			}
		});
	}

	public List loadAll(final Class entityClass) throws DataAccessException {
		return (List) executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				Criteria criteria = session.createCriteria(entityClass);
				prepareCriteria(criteria);
				return criteria.list();
			}
		});
	}

	public void load(final Object entity, final Serializable id) throws DataAccessException {
		executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				session.load(entity, id);
				return null;
			}
		});
	}

	public void refresh(final Object entity) throws DataAccessException {
		refresh(entity, null);
	}

	public void refresh(final Object entity, final LockMode lockMode) throws DataAccessException {
		executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				if (lockMode != null) {
					session.refresh(entity, lockMode);
				}
				else {
					session.refresh(entity);
				}
				return null;
			}
		});
	}

	public boolean contains(final Object entity) throws DataAccessException {
		Boolean result = (Boolean) executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) {
				return (session.contains(entity) ? Boolean.TRUE : Boolean.FALSE);
			}
		});
		return result.booleanValue();
	}

	public void evict(final Object entity) throws DataAccessException {
		executeWithNativeSession(new HibernateCallback() {
			public Object doInHibernate(Session session) throws HibernateException {
				session.evict(entity);
				return null;
			}
		});
	}

	public void initialize(Object proxy) throws DataAccessException {
		try {
			Hibernate.initialize(proxy);
		}
		catch (HibernateException ex) {
			throw SessionFactoryUtils.convertHibernateAccessException(ex);
		}
	}

	public Filter enableFilter(String filterName) throws IllegalStateException {
		Session session = SessionFactoryUtils.getSession(getSessionFactory(), false);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲不卡av一区二区三区| 精品乱人伦一区二区三区| 亚洲天堂2016| 91福利在线看| 婷婷综合五月天| 欧美一区二区三区小说| 精品一区免费av| 国产女人aaa级久久久级| 成a人片亚洲日本久久| 亚洲欧美日韩久久精品| 欧美乱熟臀69xxxxxx| 青青草视频一区| 国产日韩欧美不卡| 91在线观看视频| 午夜亚洲国产au精品一区二区| 欧美福利视频一区| 久久国产综合精品| 国产精品网站一区| 在线中文字幕一区| 国产在线看一区| 最新不卡av在线| 91精品在线免费| 国产成人精品综合在线观看| 亚洲人午夜精品天堂一二香蕉| 欧美日韩国产欧美日美国产精品| 久久99最新地址| 亚洲视频图片小说| 日韩一区二区在线看片| 99久久亚洲一区二区三区青草| 亚洲高清免费观看高清完整版在线观看| 欧美成人精品二区三区99精品| 成人精品高清在线| 欧美aaa在线| 国产精品电影院| 日韩欧美一级在线播放| 99久久国产综合精品色伊 | 国产欧美一区二区精品婷婷| 色综合中文综合网| 极品少妇xxxx偷拍精品少妇| 亚洲欧洲国产日韩| 日韩一级黄色片| 色综合亚洲欧洲| 国产高清不卡一区| 日韩精品一二三四| 亚洲激情图片qvod| 国产精品美女久久久久aⅴ| 欧美一区二区三区日韩视频| 91社区在线播放| 国产成人8x视频一区二区| 日韩高清不卡一区二区| 亚洲精品v日韩精品| 国产精品国产精品国产专区不片| 日韩欧美国产小视频| 欧美日韩久久久| 91麻豆国产精品久久| 成人国产精品免费网站| 精品亚洲porn| 日本三级亚洲精品| 亚洲国产美国国产综合一区二区| 国产精品成人网| 国产欧美1区2区3区| 久久午夜国产精品| 精品久久久久久亚洲综合网| 欧美日韩视频不卡| 欧美性生活久久| 色欧美乱欧美15图片| 92国产精品观看| 95精品视频在线| 91美女福利视频| 一本久道中文字幕精品亚洲嫩| 成人小视频在线观看| 成人一级视频在线观看| 成人性生交大片免费看中文网站| 国产精品一二三四五| 国产高清无密码一区二区三区| 国产精品综合在线视频| 国产精品1区2区3区在线观看| 韩国女主播一区二区三区| 韩国精品主播一区二区在线观看 | 日本丶国产丶欧美色综合| 97精品国产97久久久久久久久久久久 | 欧美图区在线视频| 欧美午夜宅男影院| 日韩欧美视频在线| 欧美绝品在线观看成人午夜影视| 欧美日韩精品一区二区三区四区| 欧美日韩五月天| 91精品国产黑色紧身裤美女| 日韩欧美一区电影| 国产午夜精品福利| 国产精品美女久久久久久久久久久 | 久久精品亚洲乱码伦伦中文| 国产亚洲综合在线| 亚洲欧洲三级电影| 亚洲一区二区三区影院| 日韩1区2区3区| 国产成人免费视频网站高清观看视频| 日韩不卡一区二区| 亚洲精品国产视频| 美女免费视频一区| 免费xxxx性欧美18vr| 日韩美女精品在线| 午夜精品免费在线观看| 成人av网站在线观看| 日韩欧美亚洲国产另类| 亚洲一区二区三区在线看| www.av精品| 精品国产凹凸成av人网站| 亚洲午夜一区二区| 91香蕉视频mp4| 欧美韩日一区二区三区| 免费成人在线观看视频| 欧美日韩久久一区| 亚洲精品成人精品456| 成人午夜激情片| 国产日韩欧美亚洲| 精品一区二区三区在线播放 | 韩日精品视频一区| 欧美老女人在线| 亚洲国产中文字幕| 日本久久电影网| 亚洲免费在线视频| voyeur盗摄精品| 日本一区二区三区dvd视频在线| 免费av成人在线| 91精品国产一区二区人妖| 视频一区中文字幕国产| 欧美人狂配大交3d怪物一区| 一区二区三区精品在线| 日本丶国产丶欧美色综合| 亚洲欧美日韩系列| 色婷婷综合久久久久中文| 亚洲欧美二区三区| 色老综合老女人久久久| 亚洲一区二区不卡免费| 欧美亚洲高清一区二区三区不卡| 亚洲一区二区三区四区的| 在线看国产日韩| 五月天激情综合| 欧美精品高清视频| 男女激情视频一区| 日韩一区二区三区电影 | 色综合欧美在线视频区| 亚洲裸体在线观看| 在线免费观看日本欧美| 亚洲成人福利片| 欧美一区三区二区| 精品一区二区三区的国产在线播放 | 色天天综合久久久久综合片| 一区二区三区小说| 欧美人伦禁忌dvd放荡欲情| 免费欧美在线视频| 精品国产99国产精品| 成人一区在线观看| 亚洲免费观看高清完整版在线 | 亚洲人成亚洲人成在线观看图片| 色婷婷久久久久swag精品| 午夜日韩在线电影| 精品精品国产高清一毛片一天堂| 国产精品18久久久久久久久久久久 | 国产精品久久久久久久久晋中| jlzzjlzz亚洲日本少妇| 亚洲美女屁股眼交| 日韩一卡二卡三卡国产欧美| 国产成人在线网站| 亚洲精品日韩一| 91精品国产综合久久久久| 国产精品乡下勾搭老头1| 亚洲天堂成人在线观看| 91精品国产麻豆国产自产在线 | 精品成人佐山爱一区二区| 成人精品小蝌蚪| 亚洲成人在线免费| 久久久久久亚洲综合影院红桃| 日本高清免费不卡视频| 激情综合色综合久久综合| 成人免费一区二区三区视频| 欧美情侣在线播放| 懂色一区二区三区免费观看 | 亚洲成av人片一区二区| 337p日本欧洲亚洲大胆色噜噜| 97成人超碰视| 免费av网站大全久久| 亚洲欧洲99久久| 欧美xxxx在线观看| 91亚洲永久精品| 激情综合网最新| 亚洲成a人在线观看| 国产偷v国产偷v亚洲高清| 欧美剧在线免费观看网站 | 欧美视频日韩视频| 国产乱色国产精品免费视频| 午夜精品久久久久久| 国产精品天干天干在观线| 欧美一区二区三级| 日本伦理一区二区| 成人免费va视频| 麻豆成人久久精品二区三区红| 亚洲综合在线观看视频| 欧美国产日韩精品免费观看|