1
库里是number类型,没有默认值
映射到xml后
<property name="locationCode" type="long">
<column name="LOCATION_CODE" precision="1" scale="0" />
</property>
当查记录的时候如果这个属性值是空,则会报错,只有当该属性非空的时候才可以查出来,这是为什么??好象是配置文件的问题 2
数据库的时间是varchar类型,长度是10
生成的xml
<property name="expaireTime" type="string">
<column name="EXPAIRE_TIME" length="10" />
</property>
在写hibernate查询语句时候
if(StringUtils.isNotBlank((String)map.get("dateBegin"))){
buffer.append(" and to_char(t.expaireTime,'yyyy-mm-dd')>= :bir_date");
if(StringUtils.isNotBlank((String)map.get("dateEnd"))){
buffer.append(" and to_char(t.expaireTime,'yyyy-mm-dd')<= :bir_date");
}
}
要比较的,这吗写也不对,请正确写法
库里是number类型,没有默认值
映射到xml后
<property name="locationCode" type="long">
<column name="LOCATION_CODE" precision="1" scale="0" />
</property>
当查记录的时候如果这个属性值是空,则会报错,只有当该属性非空的时候才可以查出来,这是为什么??好象是配置文件的问题 2
数据库的时间是varchar类型,长度是10
生成的xml
<property name="expaireTime" type="string">
<column name="EXPAIRE_TIME" length="10" />
</property>
在写hibernate查询语句时候
if(StringUtils.isNotBlank((String)map.get("dateBegin"))){
buffer.append(" and to_char(t.expaireTime,'yyyy-mm-dd')>= :bir_date");
if(StringUtils.isNotBlank((String)map.get("dateEnd"))){
buffer.append(" and to_char(t.expaireTime,'yyyy-mm-dd')<= :bir_date");
}
}
要比较的,这吗写也不对,请正确写法
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货