001    /*
002     * Sonar, open source software quality management tool.
003     * Copyright (C) 2008-2011 SonarSource
004     * mailto:contact AT sonarsource DOT com
005     *
006     * Sonar is free software; you can redistribute it and/or
007     * modify it under the terms of the GNU Lesser General Public
008     * License as published by the Free Software Foundation; either
009     * version 3 of the License, or (at your option) any later version.
010     *
011     * Sonar is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014     * Lesser General Public License for more details.
015     *
016     * You should have received a copy of the GNU Lesser General Public
017     * License along with Sonar; if not, write to the Free Software
018     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019     */
020    package org.sonar.core.persistence;
021    
022    /**
023     * @since 2.13
024     */
025    public final class DatabaseUtils {
026      /**
027       * Oracle: number of elements in IN statements is limited.
028       */
029      public static final int MAX_IN_ELEMENTS = 1000;
030    
031      private DatabaseUtils() {
032      }
033    
034      /**
035       * List of all the tables.
036       * This list is hardcoded because we didn't succeed in using java.sql.DatabaseMetaData#getTables() in the same way
037       * for all the supported databases, particularly due to Oracle results.
038       */
039      static final String[] TABLE_NAMES = {
040        "action_plans",
041        "action_plans_reviews",
042        "active_dashboards",
043        "active_filters",
044        "active_rules",
045        "active_rule_changes",
046        "active_rule_parameters",
047        "active_rule_param_changes",
048        "alerts",
049        "characteristics",
050        "characteristic_edges",
051        "characteristic_properties",
052        "criteria",
053        "dashboards",
054        "dependencies",
055        "duplications_index",
056        "events",
057        "filters",
058        "filter_columns",
059        "groups",
060        "groups_users",
061        "group_roles",
062        "loaded_templates",
063        "manual_measures",
064        "measure_data",
065        "metrics",
066        "notifications",
067        "projects",
068        "project_links",
069        "project_measures",
070        "properties",
071        "quality_models",
072        "resource_index",
073        "reviews",
074        "review_comments",
075        "rules",
076        "rules_categories",
077        "rules_parameters",
078        "rules_profiles",
079        "rule_failures",
080        "schema_migrations",
081        "snapshots",
082        "snapshot_sources",
083        "users",
084        "user_roles",
085        "widgets",
086        "widget_properties"};
087    }