From 7544ade116333ce903f5174207b05a318b11a6e8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 15 May 2014 17:05:32 +0200 Subject: SONAR-5007 add RuleService#setNote --- .../src/main/java/org/sonar/core/db/Dao.java | 51 ---------------------- .../src/main/java/org/sonar/core/db/Dto.java | 47 -------------------- .../main/java/org/sonar/core/db/package-info.java | 23 ---------- .../main/java/org/sonar/core/persistence/Dto.java | 47 ++++++++++++++++++++ .../core/qualityprofile/db/ActiveRuleDto.java | 2 +- .../core/qualityprofile/db/QualityProfileDto.java | 2 +- .../src/main/java/org/sonar/core/rule/RuleDto.java | 2 +- 7 files changed, 50 insertions(+), 124 deletions(-) delete mode 100644 sonar-core/src/main/java/org/sonar/core/db/Dao.java delete mode 100644 sonar-core/src/main/java/org/sonar/core/db/Dto.java delete mode 100644 sonar-core/src/main/java/org/sonar/core/db/package-info.java create mode 100644 sonar-core/src/main/java/org/sonar/core/persistence/Dto.java (limited to 'sonar-core') diff --git a/sonar-core/src/main/java/org/sonar/core/db/Dao.java b/sonar-core/src/main/java/org/sonar/core/db/Dao.java deleted file mode 100644 index f19951d065f..00000000000 --- a/sonar-core/src/main/java/org/sonar/core/db/Dao.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.core.db; - -import org.sonar.api.ServerComponent; -import org.sonar.core.persistence.DbSession; - -import javax.annotation.CheckForNull; -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -public interface Dao, K extends Serializable> extends ServerComponent { - - @CheckForNull - E getByKey(K key, DbSession session); - - E update(E item, DbSession session); - - List update(List items, DbSession session); - - E insert(E item, DbSession session); - - List insert(List items, DbSession session); - - void delete(E item, DbSession session); - - void delete(Collection items, DbSession session); - - void deleteByKey(K key, DbSession session); - - Iterable keysOfRowsUpdatedAfter(long timestamp, DbSession session); - -} diff --git a/sonar-core/src/main/java/org/sonar/core/db/Dto.java b/sonar-core/src/main/java/org/sonar/core/db/Dto.java deleted file mode 100644 index ba29f7a35cf..00000000000 --- a/sonar-core/src/main/java/org/sonar/core/db/Dto.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.core.db; - -import java.io.Serializable; -import java.util.Date; - -public abstract class Dto { - - private Date createdAt; - private Date updatedAt; - - public abstract K getKey(); - - public void setCreatedAt(Date datetime){ - this.createdAt = datetime; - } - - public void setUpdatedAt(Date datetime){ - this.updatedAt = datetime; - } - - public Date getCreatedAt(){ - return this.createdAt; - } - - public Date getUpdatedAt(){ - return this.updatedAt; - } -} diff --git a/sonar-core/src/main/java/org/sonar/core/db/package-info.java b/sonar-core/src/main/java/org/sonar/core/db/package-info.java deleted file mode 100644 index cb50b641aa3..00000000000 --- a/sonar-core/src/main/java/org/sonar/core/db/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -@ParametersAreNonnullByDefault -package org.sonar.core.db; - -import javax.annotation.ParametersAreNonnullByDefault; 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 new file mode 100644 index 00000000000..d604962cbf9 --- /dev/null +++ b/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java @@ -0,0 +1,47 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.core.persistence; + +import java.io.Serializable; +import java.util.Date; + +public abstract class Dto { + + private Date createdAt; + private Date updatedAt; + + public abstract K getKey(); + + public void setCreatedAt(Date datetime){ + this.createdAt = datetime; + } + + public void setUpdatedAt(Date datetime){ + this.updatedAt = datetime; + } + + public Date getCreatedAt(){ + return this.createdAt; + } + + public Date getUpdatedAt(){ + return this.updatedAt; + } +} diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java index 1b0039b84ca..47e14519a82 100644 --- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java +++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java @@ -23,7 +23,7 @@ package org.sonar.core.qualityprofile.db; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.ReflectionToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; -import org.sonar.core.db.Dto; +import org.sonar.core.persistence.Dto; import org.sonar.core.rule.RuleDto; import org.sonar.core.rule.SeverityUtil; diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java index 643c9762abb..cdf29be0e56 100644 --- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java +++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java @@ -20,7 +20,7 @@ package org.sonar.core.qualityprofile.db; -import org.sonar.core.db.Dto; +import org.sonar.core.persistence.Dto; import javax.annotation.CheckForNull; import javax.annotation.Nullable; diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java index e50615d49c6..87fb8803b2f 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java @@ -26,7 +26,7 @@ import org.apache.commons.lang.builder.ReflectionToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.sonar.api.rule.RuleKey; import org.sonar.check.Cardinality; -import org.sonar.core.db.Dto; +import org.sonar.core.persistence.Dto; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -- cgit v1.2.3