001/* 002 * Sonar, open source software quality management tool. 003 * Copyright (C) 2008-2012 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 */ 020package org.sonar.core.persistence; 021 022/** 023 * @since 2.13 024 */ 025public 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_rules", 044 "active_rule_changes", 045 "active_rule_parameters", 046 "active_rule_param_changes", 047 "alerts", 048 "authors", 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_parameters", 077 "rules_profiles", 078 "rule_failures", 079 "schema_migrations", 080 "snapshots", 081 "snapshot_sources", 082 "users", 083 "user_roles", 084 "widgets", 085 "widget_properties"}; 086}