我的表映射文件:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="entity.Emp" table="EMP" schema="SCOTT">
        <id name="empno" type="long">
            <column name="EMPNO" precision="4" scale="0" />
            <generator class="native" />
        </id>
        <property name="ename" type="string">
            <column name="ENAME" length="10" />
        </property>
        <property name="job" type="string">
            <column name="JOB" length="9" />
        </property>
        <property name="mgr" type="long">
            <column name="MGR" precision="4" scale="0" />
        </property>
        <property name="hiredate" type="date">
            <column name="HIREDATE" length="7" />
        </property>
        <property name="sal" type="double">
            <column name="SAL" precision="7" />
        </property>
        <!--
        <property name="comm" type="double">
            <column name="COMM" precision="7" />
        </property>
        
        
         -->    </class>
</hibernate-mapping>我的hibernate.cfg.xml:<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration> <session-factory>
<property name="connection.username">scott</property>
<property name="connection.url">
jdbc:oracle:thin:@localhost:1521:myOra
</property>
<property name="dialect">
org.hibernate.dialect.OracleDialect
</property>
<property name="myeclipse.connection.profile">oracle</property>
<property name="connection.password">tiger</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>

<mapping resource="entity/Emp.hbm.xml" /> </session-factory></hibernate-configuration>
我的DAO:package dao;import java.util.List;import org.hibernate.Query;
import org.hibernate.Session;import util.HibernateSessionFactory;import entity.Emp;public class EmpDaoImpl extends BaseDao implements EmpDao{ public List<Emp> selectAll() {
  Session session = this.getSession();
  System.out.println("session------------"+session);
  String hql ="from Emp emp";
  Query query = session.createQuery(hql);
  System.out.println("query---------------"+query.getQueryString());
  List<Emp> list = query.list();
  session.close();
      return list;
} public Emp selectById(long id) {
Session session = this.getSession();
Emp e = (Emp) session.get(Emp.class, id);
System.out.println("daoimpl------------------"+e);
return e;
}}问题:当进行id查询的时候,如果遇到数据库字段为null的情况时候,那么会报错,如下:org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of entity.Emp.setComm