Code example for SessionFactory

Methods: close

0
 
	@Override 
	public void tearDown() throws Exception {
		//close session factories 
		if ( slaveSessionFactory != null ) {
			slaveSessionFactory.close();
			slaveSessionFactory = null;
		} 
		super.tearDown(); 
	} 
 
	private void buildSlaveSessionFactory() throws Exception {
		if ( slaveSessionFactory != null ) {
			throw new IllegalStateException( "slaveSessionFactory already created" );
		} 
		setCommonCfg( new Configuration() );
		commonConfigure( commonCfg );
		for ( Class<?> aClass : getCommonAnnotatedClasses() ) {
			getCommonConfiguration().addAnnotatedClass( aClass );
		} 
Connect your IDE to all the code out there  Get Codota for Java