public BigDecimal getTax() {return tax == null ? BigDecimal.ZERO : tax;}
這是自定義的一個類 對null 做出了處理。
但是如果是直接從xml? 查詢返回的該對象, tax() 字段還是會產生null
<resultMap id="twoToNine" type="" ><result column="tax_data" property="tax" jdbcType="DECIMAL" /><result column="fiscal_ret" property="revenue" jdbcType="DECIMAL" /><result column="corp_name" property="name" jdbcType="VARCHAR"/></resultMap>
?