-
Problème avec Hibernate
Hello all
I have a problem with hibernate: I have installed Hibernate3 hibernate2 and I import them.But the problem persists at the session.
My java code:
import net.*;
import org.*;
import com.*;
import java.util.*;
import net.sf.hibernate.*;
import com.test.java.hibernate.*;
public class Test{
public static void main(String[]args) throws HibernateException{
//The method beginTransaction() is undefined for the type Session
Session session=HibernateUtil.currentSession();
Transaction tx=session.beginTransaction();
TContact contact= new TContact();
contact.setNom("Dupont");
contact.setPrenom("Jean");
contact.setAge(new Integer(44));
session.save(contact);
contact= new TContact();
contact.setNom("Lambert");
contact.setPrenom("Julie");
contact.setAge(new Integer(27));
session.save(contact);
tx.commit();
HibernateUtil.closeSession();
}
}