求解 按視頻做了以后沒有生成一對多關(guān)聯(lián)關(guān)系 Grade類里面沒有set集合。。
2016-01-09
hibernate中聲明集合屬性一般都需要初始化,因為要像其中添加數(shù)據(jù)。private Set<Student> students; 這行代碼如果想調(diào)試時不提示空指針
可以初始化一下:private Set<Student> students = new HashSet<Student>();
可以初始化一下:private Set<Student> students = new HashSet<Student>();
2016-01-08
額,執(zhí)行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涉及到復(fù)雜的SQL查詢,使用起來比起可以直接寫SQL查詢出對應(yīng)數(shù)據(jù)的持久層框架感覺麻煩了好多
2015-12-26
已采納回答 / 蜜罐里的孩紙
關(guān)閉后,按照視頻中的代碼無法再次創(chuàng)建。因為getSessionFactory方法是直接返回sessionFactory;而getSession方法是會話工廠創(chuàng)建會話后返回session。sessionFactory初始化在static,只執(zhí)行一次
2015-12-15