Problem with LockMode
Hi all,
I am experiencing a problem while integrating Hibernate with Spring.
Problem:-
While compiling the error comming is....
The type net.sf.hibernate.SessionFactory cannot be resolved. It is indirectly referenced from required .class files
The code is as bellow:--
import org.springframework.orm.hibernate.HibernateTemplat e;
import org.hibernate.LockMode;
import org.hibernate.SessionFactory;
import com.cingular.phoenix.vo.Employee;
public class EmployeeDaoHibernate {
private SessionFactory sessionFactory;
private HibernateTemplate hibernateTemplate;
public void setSessionFactory(SessionFactory sessionFactory){
this.sessionFactory = sessionFactory;
this.hibernateTemplate = new HibernateTemplate(this.sessionFactory);
}
public Employee getEmployee(int id) {
Integer empId= new Integer(id);
return (Employee) hibernateTemplate.load(Employee.class, empId,LockMode.READ);
}
}
I am using the latest Spring 1.2.1 and Hibernate 3.0
I have seen that while building the latest Spring , the build was refering to some net.sf.net.sf.hibernate package was used for the classes like SessionFactory and Hibernatetemplate.
The signature of the constructors are as follows...
public org.springframework.orm..hibernate.Hibernatetempla te(net.sf.hibernate.SessionFactory arg);
public org.springframework.orm..hibernate.Hibernatetempla te(net.sf.hibernate.SessionFactory arg, boolean arg);
You can see how the SessionFactory is referenced from the net.sf.hibernate package while compiling. But there is no such package in the latest jars. I am not sure whether this is the source of the compilation problem or it might be any thing else.
So if some body can kindly help me getting the solution?
Thanks in advance.
Thanks and Regards,
Mahendra Kumar Dash
Contact: 09886265054