最新回答 / 慕仙1992114
public class HibernateUtil { private static SessionFactory sessionFactory = null; static { sessionFactory = new Configuration().configure().buildSessionFactory(); } public static SessionFactory getSessionFactory() { return sessionFactory; } public stati...
2016-07-10
已采纳回答 / 沟沟
编码问题很好解决,Window-->Preferences-->General-->Workspace-->左下角的Text file encoding 然后选中others选项,把字符编码改成utf8 就可以了至于另一个问题,我建议你重新对着老师的代码再敲一遍,问题就可以解决了
2016-07-05
最新回答 / rubens
老师的hibernate.cfg.xml中<property name="hbm2ddl.auto">update</property>值update,那需要数据库原先有表,如果你不想自己写的话可以将update改成create也是可以的,但是每次都会重建,所以第一次建表后就改成update吧。
2016-06-01
最新回答 / Like_a_fool
可能是Grade.java里面这个private Set<Student> students=new HashSet<Student>();
2016-05-31