查詢時報錯
班級可以查出來,執行Set<Student> s= g.getStudents();查不出內容,控制臺提示
Hibernate:?
? ? select
? ? ? ? students0_.GID as GID4_0_1_,
? ? ? ? students0_.SID as SID1_1_1_,
? ? ? ? students0_.SID as SID1_1_0_,
? ? ? ? students0_.SNAME as SNAME2_1_0_,
? ? ? ? students0_.SEX as SEX3_1_0_?
? ? from
? ? ? ? STUDENT students0_?
? ? where
? ? ? ? students0_.GID=?
十月 23, 2016 12:21:15 上午 org.hibernate.engine.loading.internal.LoadContexts cleanup
WARN: HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@42e3c02a<rs=com.mysql.jdbc.JDBC4ResultSet@70ef6368>
十月 23, 2016 12:21:15 上午 org.hibernate.engine.loading.internal.CollectionLoadContext cleanup
WARN: HHH000160: On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries
2016-10-23
找到問題了,沒有無參的構造函數