Code example for Session

Methods: getClass

0
	 * in turn refer to the Session (for example, for lazy loading). 
	 * @param session the Hibernate Session to stringify 
	 * @return the String representation of the given Session 
	 */ 
	public static String toString(Session session) { 
		return session.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(session)); 
	} 
 
	/** 
	 * Return whether there is a transactional Hibernate Session for the current thread, 
	 * that is, a Session bound to the current thread by Spring's transaction facilities. 
	 * @param sessionFactory Hibernate SessionFactory to check (may be {@code null}) 
	 * @return whether there is a transactional Session for current thread 
	 */ 
	public static boolean hasTransactionalSession(SessionFactory sessionFactory) { 
		if (sessionFactory == null) { 
			return false; 
		} 
		SessionHolder sessionHolder = 
				(SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);