org.sonar.db.notification.NotificationQueueMapper.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-db-dao Show documentation
Show all versions of sonar-db-dao Show documentation
Open source platform for continuous inspection of code quality
The newest version!
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd"> <mapper namespace="org.sonar.db.notification.NotificationQueueMapper"> <insert id="insert" parameterType="NotificationQueue" useGeneratedKeys="false"> INSERT INTO notifications (data) VALUES (#{data}) </insert> <delete id="delete" parameterType="long"> delete from notifications where id=#{id} </delete> <select id="count" resultType="long"> select count(1) from notifications </select> <select id="findOldest" parameterType="int" resultType="NotificationQueue"> select id, data from notifications order by id asc limit #{count} </select> <!-- SQL Server --> <select id="findOldest" parameterType="int" resultType="NotificationQueue" databaseId="mssql"> select top (#{count}) id, data from notifications order by id asc </select> <!-- Oracle --> <select id="findOldest" parameterType="int" resultType="NotificationQueue" databaseId="oracle"> select * from (select id, data from notifications order by id asc ) where rownum <= #{count} </select> </mapper>