hibernate中声明集合属性一般都需要初始化,因为要像其中添加数据。private Set<Student> students; 这行代码如果想调试时不提示空指针
可以初始化一下:private Set<Student> students = new HashSet<Student>();
可以初始化一下:private Set<Student> students = new HashSet<Student>();
2016-01-08
额,执行SQL语句报错~
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
2015-12-28
难怪以前老师说hibernate灵活性低,无法自己写SQL涉及到复杂的SQL查询,使用起来比起可以直接写SQL查询出对应数据的持久层框架感觉麻烦了好多
2015-12-26
已采纳回答 / 蜜罐里的孩纸
关闭后,按照视频中的代码无法再次创建。因为getSessionFactory方法是直接返回sessionFactory;而getSession方法是会话工厂创建会话后返回session。sessionFactory初始化在static,只执行一次
2015-12-15