这是个测试hibernate的student类出现了一些问题,
import org.hibernate.cfg.*;import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.xuyihui.*;//引入的是我自己间的包
public class StudentTest {
public static void main(String[] args)
{
Student s =new Student();
s.setId(11);
s.setAge(2);
s.setName("小护航");
Configuration cfg= new Configration();
SessionFactory sf=cfg.configuration().buildSssionFactory();
Session session =sf.open()Session();
session.beginTransaction();
session.save();
session.getTransaction().commit();
session.close();
sf.close();
}
}
//Configuration cfg= new Configration();
SessionFactory sf=cfg.configuration().buildSssionFactory();
Session session =sf.open()Session();
//import org.hibernate.cfg.*;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
出现错误,特别是为什么会显示我引入的包有问题呢!
下面是错误提示(红线的就是)