From e6ec7cfad7ed7393451d6f0e239c347f5bff8dc8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 21 Nov 2012 09:49:45 +0100 Subject: [PATCH] SONAR-3287 fix compatibility with Oracle --- .../org/sonar/core/persistence/SemaphoreDto.java | 10 ++++++++++ .../org/sonar/core/persistence/SemaphoreMapper.xml | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java b/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java index 01f84aa3902..77434345069 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java @@ -27,6 +27,7 @@ import java.util.Date; * @since 3.4 */ public class SemaphoreDto { + private Long id; private String name; private String checksum; private Date lockedAt; @@ -49,4 +50,13 @@ public class SemaphoreDto { this.lockedAt = d; return this; } + + public Long getId() { + return id; + } + + public SemaphoreDto setId(Long id) { + this.id = id; + return this; + } } diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml b/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml index bd56b88be1c..cf824381d16 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml @@ -8,10 +8,22 @@ VALUES (#{name}, #{checksum}, current_timestamp, current_timestamp, #{lockedAt}) + + + select semaphores_seq.NEXTVAL from DUAL + + INSERT INTO semaphores (id, name, checksum, created_at, updated_at, locked_at) + VALUES (#{id}, #{name}, #{checksum}, current_timestamp, current_timestamp, #{lockedAt}) + + + + update semaphores set updated_at = current_timestamp, locked_at = current_timestamp -- 2.39.5