user下的hbm.xml
---------------------------
<set
name="Recordset"
table="record"
cascade="all"
>
<key
column="userid"
>
</key> <one-to-many
class="com.pb.dbh.Record"
/>
</set>record的hbm.xml:
-------------------
你的many-to-one中class属性,路径要对,是com.pb.dbh.Userinfo而不是Userinfo然后你在你的对象模型类里面加上相应的字段就可以了。
---------------------------
<set
name="Recordset"
table="record"
cascade="all"
>
<key
column="userid"
>
</key> <one-to-many
class="com.pb.dbh.Record"
/>
</set>record的hbm.xml:
-------------------
你的many-to-one中class属性,路径要对,是com.pb.dbh.Userinfo而不是Userinfo然后你在你的对象模型类里面加上相应的字段就可以了。
net.sf.hibernate.PropertyNotFoundException: Could not find a getter for Recordset in class com.pb.dbh.Userinfo
java.lang.NullPointerException
at Test.show(Test.java:30)
at Test.main(Test.java:18)