We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * 插入用户,返回用户id * 需要注意的是在mapper接口中不能使用@Param("")绑定传入实体参数,这样主键会绑定到新建的实体中。 * 如@Param("user") UserEntity user主键会绑定到新建的实体,即getId() = null。 * * @param user 用户实体 * @return Long */ Long insertUser(UserEntity user); // Long insertUser(@Param("user") UserEntity user) 使用@Param("")绑定传入实体参数,会使主键绑定到新建的实体中
<insert id="insertUser" parameterType="User"> <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String"> select replace(uuid(), '-', '') as id from dual </selectKey> insert into user(id, name, birth) values (#{id}, #{name}, #{birth}) </insert>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: