UUID主鍵生成

<insert id="insert" parameterType="com.bdit.pojo.Message" >
   <selectKey keyProperty="id你的主鍵名" resultType="String" order="BEFORE">
            select replace(uuid(),'-','') from dual 
   </selectKey>
   //以上原樣照抄
    insert into message (id, name, text
      )
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}
      )
  </insert>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章