PostgreSQL+MyBatis+Insert+Autogenerated ID
<mapper> | |
<select id="add_book" parameterType="map" resultType="map"> | |
INSERT | |
INTO BOOK(NAME,TITLE,DESCRIPTION) | |
VALUES | |
(#{name},#{title},#{description}) | |
RETURNING *; | |
</select> | |
<select id="add_book" parameterType="list" resultType="map"> | |
INSERT | |
INTO BOOK(NAME,TITLE,DESCRIPTION) | |
VALUES | |
<foreach collection="list" item="item" index="index" open="" separator="," close=""> | |
(#{item.name},#{item.title},#{item.description}) | |
</foreach> | |
RETURNING *; | |
</select> | |
</mapper> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment