Using Mybatis today, after configuring the XML file, an error was reported at startup, the error message is as follows:
The insert configuration in xml is as follows:
<!-- 添加用户 -->
<insert id="addUser" parameterType="com.ltf.entity.User"
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
<selectKey keyProperty="id" resultType="java.lang.Integer"
order="after">
select
last_insert_id()
</selectKey>
insert into
<include refid="table" />
(
<include refid="edu_user_column" />
)
values(
<include refid="edu_user_property" />
)
</insert>
The reason for the error: the order value must be one of "BEFORE AFTER", which is case sensitive.
Correction: Change after to AFTER.