Hello,
We are having performance issues with one of the queries generate by Hibernate. What I am trying to do is to replace HQL with Oracle sql query. However I am unable to read connection infromation from configuration file.
I am getting the following exception
Quote:
java.io.FileNotFoundException: class path resource [applicationContext-hibernate.xml] cannot be opened because it does not exist
Here are the code snippets
Code:
private ApplicationContext applicationContext;
Attmpting to set context. That's were I get an exception
Code:
public void setApplicationContext(String ac) {
this.applicationContext = ac==null?new ClassPathXmlApplicationContext(new String[] {"applicationContext-hibernate.xml" })
:new ClassPathXmlApplicationContext(new String[] {ac});
}
Here I am trying to initialize session with the data I "read" from config file but I can't since I get an Exception when trying to load a context.
Code:
sessionFactory=(SessionFactory) getApplicationContext().getBean("sessionFactory");
session=sessionFactory.openSession();
Please help.