AnnoationConfiguration cannot be resolved to a type
琢石 2014-11-06 08:17:21 import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.bjsxt.hibernate.model.teacher;
public class TeacherTest {
public static void main(String[] args)
{
teacher t=new teacher();
t.setId(2);
t.setName("t");
t.setTitle("中级");
Configuration cfg = new AnnoationConfiguration();
SessionFactory sf=cfg.configure().buildSessionFactory();
Session session=sf.openSession();
session.beginTransaction();
session.save(t);
session.getTransaction().commit();
session.close();
sf.close();
}
}
上述main()方法中的AnnoationConfiguration()一直报错,提示AnnoationConfiguration cannot be resolved to a type,还请大家帮忙看看,谢谢!