aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-06 16:35:41 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-06 16:35:41 +0200
commitde76ce29cf55f7143ae0f468deb49f256884f999 (patch)
tree8fc5848a38cd2a176d37921c0b950305f1ddbdb9 /sonar-db
parentcc40fc4d4f74aa1eab62cc1a144fdca04c92ed18 (diff)
downloadsonarqube-de76ce29cf55f7143ae0f468deb49f256884f999.tar.gz
sonarqube-de76ce29cf55f7143ae0f468deb49f256884f999.zip
Add classes for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java31
-rw-r--r--sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java38
-rw-r--r--sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java40
-rw-r--r--sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java40
-rw-r--r--sonar-db/src/main/java/org/sonar/db/DatabaseUtils.java6
-rw-r--r--sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java2
6 files changed, 151 insertions, 6 deletions
diff --git a/sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java b/sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java
new file mode 100644
index 00000000000..1a153cc90cd
--- /dev/null
+++ b/sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
+ *
+ * @deprecated since 5.2, should be replaced by {@link org.sonar.db.DatabaseUtils}
+ */
+@Deprecated
+public class DatabaseUtils extends org.sonar.db.DatabaseUtils {
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java
new file mode 100644
index 00000000000..2e6d35e9f91
--- /dev/null
+++ b/sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java
@@ -0,0 +1,38 @@
+/*
+ * 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 org.sonar.db.Database;
+import org.sonar.db.deprecated.WorkQueue;
+
+/**
+ * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
+ *
+ * @deprecated since 5.2, should be replaced by {@link org.sonar.db.MyBatis}
+ */
+@Deprecated
+public class MyBatis extends org.sonar.db.MyBatis {
+
+ public MyBatis(Database database, WorkQueue<?> queue) {
+ super(database, queue);
+ }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java b/sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java
new file mode 100644
index 00000000000..58437280428
--- /dev/null
+++ b/sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java
@@ -0,0 +1,40 @@
+/*
+ * 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.properties;
+
+import org.sonar.db.MyBatis;
+
+/**
+ * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
+ *
+ * @deprecated since 5.2, should be replaced by {@link org.sonar.db.property.PropertiesDao}
+ */
+@Deprecated
+public class PropertiesDao extends org.sonar.db.property.PropertiesDao {
+
+ public PropertiesDao(MyBatis mybatis) {
+ super(mybatis);
+ }
+
+ public void setProperty(PropertyDto property) {
+ super.setProperty(property);
+ }
+}
diff --git a/sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java b/sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java
new file mode 100644
index 00000000000..57b2da5716f
--- /dev/null
+++ b/sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java
@@ -0,0 +1,40 @@
+/*
+ * 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.properties;
+
+/**
+ * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
+ *
+ * @deprecated since 5.2, should be replaced by {@link org.sonar.db.property.PropertyDto}
+ */
+@Deprecated
+public class PropertyDto extends org.sonar.db.property.PropertyDto {
+
+ public PropertyDto setKey(String key) {
+ super.setKey(key);
+ return this;
+ }
+
+ public PropertyDto setValue(String value) {
+ super.setValue(value);
+ return this;
+ }
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/DatabaseUtils.java b/sonar-db/src/main/java/org/sonar/db/DatabaseUtils.java
index 6d74d2474cc..71eb3596d65 100644
--- a/sonar-db/src/main/java/org/sonar/db/DatabaseUtils.java
+++ b/sonar-db/src/main/java/org/sonar/db/DatabaseUtils.java
@@ -33,14 +33,10 @@ import org.slf4j.LoggerFactory;
import static com.google.common.collect.Lists.newArrayList;
-public final class DatabaseUtils {
+public class DatabaseUtils {
private static final int PARTITION_SIZE_FOR_ORACLE = 1000;
- private DatabaseUtils() {
- // only static methods
- }
-
public static void closeQuietly(@Nullable Connection connection) {
if (connection != null) {
try {
diff --git a/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java b/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java
index 10456ace24c..91e68f8d24b 100644
--- a/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java
@@ -21,7 +21,7 @@ package org.sonar.db.property;
import com.google.common.base.Objects;
-public final class PropertyDto {
+public class PropertyDto {
private Long id;
private String key;
private String value;