首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

session报java.lang.NullPointerException异常!

2014-01-26 
session报java.lang.NullPointerException异常?//表major的映射文件 hibernate-mapping class name co

session报java.lang.NullPointerException异常?

//表major的映射文件
<hibernate-mapping>
<class name= "com.crownsoft.qsm.bean.Major " table= "major ">
<id name= "id " type= "java.lang.String ">
<column name= "id " length= "2 " />
<generator class= "increment " />
</id>
<property name= "name " type= "java.lang.String ">
<column name= "name " length= "20 " not-null= "true " />
</property>
<property name= "shortname " type= "java.lang.String ">
<column name= "shortname " length= "10 " not-null= "true " />
</property>
<property name= "department " type= "java.lang.String ">
<column name= "department " length= "4 " not-null= "true " />
</property>
<set name= "classes " inverse= "true " cascade= "all ">
<key>
  <column name= "majorid " length= "2 " not-null= "true " />
</key>
<one-to-many class= "com.crownsoft.qsm.bean.Classes " />
</set>
</class>
</hibernate-mapping>
//表classes的映射文件
<hibernate-mapping>
<class name= "com.crownsoft.qsm.bean.Classes " table= "classes ">
<id name= "id " type= "java.lang.Integer ">
<column name= "id " />
<generator class= "increment " />
</id>
<many-to-one name= "major " class= "com.crownsoft.qsm.bean.Major " fetch= "select ">
<column name= "majorid " length= "2 " not-null= "true " />
</many-to-one>
<property name= "name " type= "java.lang.String ">
<column name= "name " length= "10 " not-null= "true " />
</property>
</class>         

热点排行