From: Stephane Gamard Date: Thu, 21 Aug 2014 14:51:35 +0000 (+0200) Subject: SONAR-5530 - IssueDto extends Dto X-Git-Tag: 4.5-RC1~121 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=90864dacb4972d0251c5659d4cb962fbd919b032;p=sonarqube.git SONAR-5530 - IssueDto extends Dto --- diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java index be0d275f1cd..858a1b7c8ff 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java @@ -27,17 +27,18 @@ import org.sonar.api.issue.internal.DefaultIssue; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.Duration; import org.sonar.api.utils.KeyValueFormat; +import org.sonar.core.persistence.Dto; import javax.annotation.CheckForNull; import javax.annotation.Nullable; - import java.io.Serializable; import java.util.Date; /** * @since 3.6 */ -public final class IssueDto implements Serializable { +public final class IssueDto extends Dto implements Serializable { + private Long id; private String kee; @@ -64,10 +65,6 @@ public final class IssueDto implements Serializable { private Date issueUpdateDate; private Date issueCloseDate; - // technical dates - private Date createdAt; - private Date updatedAt; - /** * Temporary date used only during scan */ @@ -79,6 +76,12 @@ public final class IssueDto implements Serializable { private String componentKey; private String rootComponentKey; + + @Override + public String getKey() { + return kee; + } + public Long getId() { return id; } @@ -261,21 +264,15 @@ public final class IssueDto implements Serializable { return this; } - public Date getCreatedAt() { - return createdAt; - } - + @Override public IssueDto setCreatedAt(Date createdAt) { - this.createdAt = createdAt; + super.setCreatedAt(createdAt); return this; } - public Date getUpdatedAt() { - return updatedAt; - } - + @Override public IssueDto setUpdatedAt(@Nullable Date updatedAt) { - this.updatedAt = updatedAt; + super.setUpdatedAt(updatedAt); return this; } diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java b/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java index 891ebcd595c..e5cfec6109b 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java @@ -29,12 +29,14 @@ public abstract class Dto { public abstract K getKey(); - public final void setCreatedAt(Date datetime) { + public Dto setCreatedAt(Date datetime) { this.createdAt = datetime; + return this; } - public final void setUpdatedAt(Date datetime) { + public Dto setUpdatedAt(Date datetime) { this.updatedAt = datetime; + return this; } public final Date getCreatedAt() {