Code example for Session

Methods: getSessionFactory

0
		SessionFactoryImplementor sessionFactoryImpl = null; 
		if (sessionFactory instanceof SessionFactoryImplementor) { 
			sessionFactoryImpl = ((SessionFactoryImplementor) sessionFactory); 
		} 
		else if (session != null) { 
			SessionFactory internalFactory = session.getSessionFactory(); 
			if (internalFactory instanceof SessionFactoryImplementor) { 
				sessionFactoryImpl = (SessionFactoryImplementor) internalFactory; 
			} 
		} 
		return (sessionFactoryImpl != null ? sessionFactoryImpl.getTransactionManager() : null); 
	} 
 
 
	/** 
	 * Get a Hibernate Session for the given SessionFactory. Is aware of and will 
	 * return any existing corresponding Session bound to the current thread, for 
	 * example when using {@link HibernateTransactionManager}. Will create a new 
	 * Session otherwise, if "allowCreate" is {@code true}. 
	 * <p>This is the {@code getSession} method used by typical data access code, 
Stop searching for code, let great code find you!  Add Codota to your java IDE