为已存在的数据表增加两个字段,我在model.xml 增加了<resultmap 。。><result property="ba_p_begindate" column="BA_P_BEGINDATE" javaType="java.lang.String" />
<result property="ba_p_enddate" column="BA_P_ENDDATE" javaType="java.lang.String" />
</resultMap><insert id="insertBa" parameterClass="ParamBa">
<![CDATA[
insert into WS_PEOPLE_BA (BA_CODE,BA_P_BEGINDATE,BA_P_ENDDATE)
values #ba_code#,#ba_p_begindate#,#ba_p_enddate#)
]]>
</insert>并且在相应添加记录的类中增加了get和set的方法,但在初始化时,应用还是出现如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [spring_common.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.
Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
Caused by: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.
Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
是不是配置文件写的有错误,或者还有其他的配置和类文件需要修改更新???请赐教!
<result property="ba_p_enddate" column="BA_P_ENDDATE" javaType="java.lang.String" />
</resultMap><insert id="insertBa" parameterClass="ParamBa">
<![CDATA[
insert into WS_PEOPLE_BA (BA_CODE,BA_P_BEGINDATE,BA_P_ENDDATE)
values #ba_code#,#ba_p_begindate#,#ba_p_enddate#)
]]>
</insert>并且在相应添加记录的类中增加了get和set的方法,但在初始化时,应用还是出现如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [spring_common.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.
Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
Caused by: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.
Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
是不是配置文件写的有错误,或者还有其他的配置和类文件需要修改更新???请赐教!
增加字段就在相应的model类中增加属性 get set ,在xml中增加了 resultmap 和插入值
但还是提示model类中没有增加的属性,并且是在应用起来之后就提示错误?????
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [com/bb/eoa/eoa_spring_common.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'. Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'eoa_spring_common.xml中没有特别的对字段修改就需要调整的语句,eoa_spring_common.xml调用了model.xml,在model.xml增加了属性和相应动作如
<result property="ba_p_begindate" column="BA_P_BEGINDATE" javaType="java.lang.String" />
<result property="ba_p_enddate" column="BA_P_ENDDATE" javaType="java.lang.String" />
</resultMap> <insert id="insertBa" parameterClass="ParamBa">
<![CDATA[
insert into WS_PEOPLE_BA (BA_CODE,BA_P_BEGINDATE,BA_P_ENDDATE)
values #ba_code#,#ba_p_begindate#,#ba_p_enddate#)
]]>
</insert>
values #ba_code#,#ba_p_begindate#,#ba_p_enddate#) ,
values后少了一个“(”,不知是不是楼主贴过来的时候漏掉了?
values后少了一个“(”,不知是不是楼主贴过来的时候漏掉了? 是我贴过来漏掉的
建议贴出完整代码