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

mybatis 实施添加报错 急初学

2011-12-03 
mybatis 执行添加报错急急急!!!初学XML code insert idinsertScenicHotelEntity parameterTypecom.h

mybatis 执行添加报错 急急急!!!初学

XML code
 <insert id="insertScenicHotelEntity" parameterType="com.hoperun.saintytours.hotel.entity.ScenicHotelEntity">         <![CDATA[ INSERT INTO m_scenic_hotel   ]]>         <trim prefix="(" suffix=")" suffixOverrides=",">            <if test="scenicHotelName != null and scenicHotelName != ''">                <![CDATA[                   scenic_hotel_name,                  ]]>                 </if>            <if test="proType != null and proType != ''">                <![CDATA[                   pro_type,                ]]>                 </if>            <if test="picPath != null and picPath != ''">                <![CDATA[                   pic_path,                 ]]>                 </if>            <if test="introduction != null and introduction != ''">                <![CDATA[                   introduction,                 ]]>                 </if>            <if test="surroundScenic != null and surroundScenic != ''">                <![CDATA[                   surround_scenic,                 ]]>                 </if>            <if test="level != null and level != ''">                <![CDATA[                   level,                 ]]>                 </if>            <if test="city != null and city != ''">                <![CDATA[                   city,                 ]]>                 </if>            <if test="address != null and address != ''">                <![CDATA[                   address,                 ]]>                 </if>            <if test="tel != null and tel != ''">                <![CDATA[                   tel,                 ]]>                 </if>            <if test="ticketRoomDesc != null and ticketRoomDesc != ''">                <![CDATA[                   ticket_room_desc,                 ]]>                 </if>            <if test="indentifier != null and indentifier != ''">                <![CDATA[                   indentifier,                 ]]>                 </if>            <if test="delFlag != null and delFlag != ''">                <![CDATA[                   del_flag,                 ]]>                 </if>            <if test="createDate != null and createDate != ''">                <![CDATA[                   create_date,                 ]]>                 </if>            <if test="createUser != null and createUser != ''">                <![CDATA[                   create_user,                 ]]>                 </if>            <if test="updateDate != null and updateDate != ''">                <![CDATA[                   update_date,                 ]]>                 </if>            <if test="updateUser != null and updateUser != ''">                <![CDATA[                   update_user,                 ]]>                 </if>        </trim>        <trim prefix="values (" suffix=")" suffixOverrides=",">            <if test="scenicHotelName != null and scenicHotelName != ''">                <![CDATA[                   #{scenicHotelName},                 ]]>                 </if>            <if test="proType != null and proType != ''">                <![CDATA[                   #{proType},                 ]]>                 </if>            <if test="picPath != null and picPath != ''">                <![CDATA[                   #{picPath},                 ]]>                 </if>            <if test="introduction != null and introduction != ''">                <![CDATA[                   #{introduction},                 ]]>                 </if>            <if test="surroundScenic != null and surroundScenic != ''">                <![CDATA[                   #{surroundScenic},                 ]]>                 </if>            <if test="level != null and level != ''">                <![CDATA[                   #{level},                 ]]>                 </if>            <if test="city != null and city != ''">                <![CDATA[                   #{city},                 ]]>                 </if>            <if test="address != null and address != ''">                <![CDATA[                   #{address},                 ]]>                 </if>            <if test="tel != null and tel != ''">                <![CDATA[                   #{tel},                 ]]>                 </if>            <if test="ticketRoomDesc != null and ticketRoomDesc != ''">                <![CDATA[                   #{ticketRoomDesc},                 ]]>                 </if>            <if test="indentifier != null and indentifier != ''">                <![CDATA[                   #{indentifier},                 ]]>                 </if>            <if test="delFlag != null and delFlag != ''">                <![CDATA[                   #{delFlag},                 ]]>                 </if>            <if test="createDate != null and createDate != ''">                <![CDATA[                   #{createDate},                 ]]>              </if>         <if test="createUser != null and createUser != ''">                <![CDATA[                   #{createUser},                 ]]>                 </if>            <if test="updateDate != null and updateDate != ''">                <![CDATA[                   #{updateDate},                 ]]>                 </if>            <if test="updateUser != null and updateUser != ''">                <![CDATA[                   #{updateUser},                 ]]>                 </if>        </trim>    </insert>     


insert 有错么? 每次去执行insert的时候 就报错



[解决办法]
scenicHotelName 是在你的pocom.hoperun.saintytours.hotel.entity.ScenicHotelEntity里的属性么?确定都有get set方法?并且是String类型?
[解决办法]

[解决办法]
1、看看是否拼错了 大小写
2、打出你的 sql 执行下看看

热点排行