Code example for AnnotationConfiguration

0
		this.applicationContext = applicationContext;
	} 
 
	@PostConstruct 
	public void create() { 
		SessionFactory original = new AnnotationConfiguration().configure().buildSessionFactory();
		factory = new SpringSessionFactory(applicationContext, original);
	} 
 
	@Override 
	public SessionFactory getInstance() {
		return factory;
	} 
 
	@PreDestroy 
	public void destroy() { 
		factory.close();
	} 
}