You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SamlMessageIdMapper.xml 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
  3. <mapper namespace="org.sonar.db.user.SamlMessageIdMapper">
  4. <sql id="columns">
  5. smi.uuid as uuid,
  6. smi.message_id as "messageId",
  7. smi.expiration_date as "expirationDate",
  8. smi.created_at as "createdAt"
  9. </sql>
  10. <select id="selectByMessageId" parameterType="String" resultType="org.sonar.db.user.SamlMessageIdDto">
  11. select
  12. <include refid="columns"/>
  13. from saml_message_ids smi
  14. where smi.message_id=#{messageId, jdbcType=VARCHAR}
  15. </select>
  16. <insert id="insert" parameterType="Map" useGeneratedKeys="false">
  17. insert into saml_message_ids
  18. (
  19. uuid,
  20. message_id,
  21. expiration_date,
  22. created_at
  23. )
  24. values (
  25. #{dto.uuid, jdbcType=VARCHAR},
  26. #{dto.messageId, jdbcType=VARCHAR},
  27. #{dto.expirationDate, jdbcType=BIGINT},
  28. #{dto.createdAt, jdbcType=BIGINT}
  29. )
  30. </insert>
  31. <delete id="deleteExpired" parameterType="Long" >
  32. delete from saml_message_ids where expiration_date &lt; #{now, jdbcType=BIGINT}
  33. </delete>
  34. </mapper>