[求助]Hibernate的删除
我在hibernate中写了一个从数据库中删除用户信息的小程序让它在主函数中运行~
但是有错~
帮忙看看~~
public static void main(String argc[])
{
SessionFactory sf=new Configuration().configure().buildSessionFactory();
Session we=sf.openSession();
Transaction wr=we.beginTransaction();
T1 u=(T1)we.get(T1.class,new Integer(1));
we.delete(u);
wr.commit();
we.close();
}
我导的包:
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.classic.Session;