<resultMap id="TypeLstMap" type="java.lang.String">
<result property="value" column="CENTER"/>
resultMap>
<select id="TypeLst" parameterType="com.sm.entity.myEntity" resultMap="TypeLstMap">
SELECT
CENTER as CENTER
FROM
JOKEN
select>
<select id="TypeLst" parameterType="com.sm.entity.myEntity" resultType="java.lang.String">
SELECT
CENTER as CENTER
FROM
JOKEN
select>
原有指定resultMap中type指定是基本数据类型
所以不要使用resultMap
直接修改为resultType
必须删除标签
Error querying database. Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find result map ‘mapper的namespace名.TypeLst’ referenced from ‘mapper的namespace名.TypeLstMap’
<select id="TypeLst" resultMap="TypeLstMap">
SELECT
CENTER as CENTER
FROM
JOKEN
select>
<resultMap id="TypeLstMap" type="com.sm.entity.myEntity">
<result property="value" column="CENTER"/>
resultMap>
<select id="TypeLst" resultMap="TypeLstMap">
SELECT
CENTER as CENTER
FROM
JOKEN
select>
imbatis在select查询定义resultMap, 但是未写
未在xml中定义resultMap
org.springframework.jdbc.UncategorizedSQLException:
Error updating database. Cause: java.sql.SQLException: ORA-01407: (“SQPRI”.“KOJIN_INF”.“USER_ID”)をNULLには更新できません。
update一张表的时候, 由于未做处理check, USER_ID未填写
数据库字段USER_ID设置不能为NULL
导致更新表的时候报错
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘file [com.rui.dao.xml.Move.xml]’. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for MoveEntityMap
xml存在两个同名ResultMap
修改其中一个名字即可
Cause: org.apache.ibatis.builder.BuilderException: Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.type.JdbcType.VARCHAR2
数据库使用oracel
将#{moveId,jdbcType=VARCHAR2}
修改为#{moveId,jdbcType=VARCHAR}
<isEqual property="mTkValue" compareProperty="mTKZ001">
--正确写法
<if test="mTkValue== mTKZ001">and
--错误写法,不能追加单引号
<if test="mTkValue== 'mTKZ001'">and