From 428f75ac81ef18acabd1b6c563a5cd3c089e762d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 10 Jul 2014 09:26:14 +0200 Subject: [PATCH] Remove lang="raw" in mybatis XML files. MyBatis 3.2.4 raw is automatically applied if the statement is static. --- .../sonar/core/activity/db/ActivityMapper.xml | 4 ++-- .../core/dashboard/ActiveDashboardMapper.xml | 4 ++-- .../sonar/core/dashboard/DashboardMapper.xml | 4 ++-- .../org/sonar/core/dashboard/WidgetMapper.xml | 2 +- .../core/dashboard/WidgetPropertyMapper.xml | 2 +- .../core/dependency/DependencyMapper.xml | 2 +- .../dependency/ResourceSnapshotMapper.xml | 2 +- .../core/duplication/DuplicationMapper.xml | 2 +- .../sonar/core/graph/jdbc/GraphDtoMapper.xml | 6 ++--- .../sonar/core/issue/db/ActionPlanMapper.xml | 2 +- .../sonar/core/issue/db/IssueChangeMapper.xml | 6 ++--- .../issue/db/IssueFilterFavouriteMapper.xml | 4 ++-- .../sonar/core/issue/db/IssueFilterMapper.xml | 6 ++--- .../org/sonar/core/issue/db/IssueMapper.xml | 8 +++---- .../core/measure/db/MeasureFilterMapper.xml | 4 ++-- .../db/NotificationQueueMapper.xml | 12 +++++----- .../permission/PermissionTemplateMapper.xml | 24 +++++++++---------- .../persistence/SchemaMigrationMapper.xml | 2 +- .../core/persistence/SemaphoreMapper.xml | 12 +++++----- .../core/properties/PropertiesMapper.xml | 22 ++++++++--------- .../db/QualityGateConditionMapper.xml | 8 +++---- .../core/qualitygate/db/QualityGateMapper.xml | 6 ++--- .../qualityprofile/db/ActiveRuleMapper.xml | 2 +- .../db/QualityProfileMapper.xml | 6 ++--- .../sonar/core/resource/ResourceMapper.xml | 8 +++---- .../org/sonar/core/rule/RuleMapper.xml | 10 ++++---- .../technicaldebt/db/CharacteristicMapper.xml | 6 ++--- .../org/sonar/core/user/AuthorMapper.xml | 6 ++--- .../org/sonar/core/user/RoleMapper.xml | 4 ++-- 29 files changed, 93 insertions(+), 93 deletions(-) diff --git a/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml b/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml index 06246058171..0c516fa3f89 100644 --- a/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml @@ -3,13 +3,13 @@ - + insert into activities (created_at, log_key, log_type, log_action, user_login, data_field, log_message) values (#{createdAt}, #{key}, #{type}, #{action}, #{author}, #{data}, #{message}) - SELECT created_at as "createdAt", log_type as "type", diff --git a/sonar-core/src/main/resources/org/sonar/core/dashboard/ActiveDashboardMapper.xml b/sonar-core/src/main/resources/org/sonar/core/dashboard/ActiveDashboardMapper.xml index 013ee97161e..16b9f3cdd74 100644 --- a/sonar-core/src/main/resources/org/sonar/core/dashboard/ActiveDashboardMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/dashboard/ActiveDashboardMapper.xml @@ -3,12 +3,12 @@ - + INSERT INTO active_dashboards (dashboard_id, user_id, order_index) VALUES (#{dashboardId}, #{userId}, #{orderIndex}) - SELECT MAX(order_index) FROM active_dashboards WHERE user_id IS NULL diff --git a/sonar-core/src/main/resources/org/sonar/core/dashboard/DashboardMapper.xml b/sonar-core/src/main/resources/org/sonar/core/dashboard/DashboardMapper.xml index e9f4803c394..9c3b1864e02 100644 --- a/sonar-core/src/main/resources/org/sonar/core/dashboard/DashboardMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/dashboard/DashboardMapper.xml @@ -3,12 +3,12 @@ - select id, user_id as "userId", name, description, column_layout as "columnLayout", shared, is_global, created_at as "createdAt", updated_at as "updatedAt" from dashboards WHERE name=#{id} and user_id is null - + INSERT INTO dashboards (user_id, name, description, column_layout, shared, is_global, created_at, updated_at) VALUES (#{userId}, #{name}, #{description}, #{columnLayout}, #{shared}, #{global}, #{createdAt}, #{updatedAt}) diff --git a/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetMapper.xml b/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetMapper.xml index 71bc01cf451..fd37b23df5f 100644 --- a/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetMapper.xml @@ -3,7 +3,7 @@ - + INSERT INTO widgets (dashboard_id, widget_key, name, description, column_index, row_index, configured, created_at, updated_at, resource_id) VALUES (#{dashboardId}, #{key}, #{name}, #{description}, #{columnIndex}, #{rowIndex}, #{configured}, #{createdAt}, #{updatedAt}, #{resourceId}) diff --git a/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetPropertyMapper.xml b/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetPropertyMapper.xml index 5ab44a79e62..b9ad3a48dee 100644 --- a/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetPropertyMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/dashboard/WidgetPropertyMapper.xml @@ -3,7 +3,7 @@ - + INSERT INTO widget_properties (widget_id, kee, text_value) VALUES (#{widgetId}, #{key}, #{value}) diff --git a/sonar-core/src/main/resources/org/sonar/core/dependency/DependencyMapper.xml b/sonar-core/src/main/resources/org/sonar/core/dependency/DependencyMapper.xml index 1ea976a0ea5..dc93ec177f2 100644 --- a/sonar-core/src/main/resources/org/sonar/core/dependency/DependencyMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/dependency/DependencyMapper.xml @@ -3,7 +3,7 @@ - SELECT id, from_snapshot_id as fromSnapshotId, to_snapshot_id as toSnapshotId, dep_usage as "usage" FROM dependencies diff --git a/sonar-core/src/main/resources/org/sonar/core/dependency/ResourceSnapshotMapper.xml b/sonar-core/src/main/resources/org/sonar/core/dependency/ResourceSnapshotMapper.xml index 5377b4f9d20..b84277f4962 100644 --- a/sonar-core/src/main/resources/org/sonar/core/dependency/ResourceSnapshotMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/dependency/ResourceSnapshotMapper.xml @@ -3,7 +3,7 @@ - SELECT id, project_id as projectId, version FROM snapshots diff --git a/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml b/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml index a2810919e0b..530c1182ebf 100644 --- a/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml @@ -17,7 +17,7 @@ - + INSERT INTO duplications_index (snapshot_id, project_snapshot_id, hash, index_in_file, start_line, end_line) VALUES (#{snapshotId}, #{projectSnapshotId}, #{hash}, #{indexInFile}, #{startLine}, #{endLine}) diff --git a/sonar-core/src/main/resources/org/sonar/core/graph/jdbc/GraphDtoMapper.xml b/sonar-core/src/main/resources/org/sonar/core/graph/jdbc/GraphDtoMapper.xml index d77105ac702..704090274f5 100644 --- a/sonar-core/src/main/resources/org/sonar/core/graph/jdbc/GraphDtoMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/graph/jdbc/GraphDtoMapper.xml @@ -3,13 +3,13 @@ - SELECT id, resource_id as resourceId, snapshot_id as snapshotId, format, version, perspective, root_vertex_id as rootVertexId, data FROM graphs WHERE snapshot_id = #{sid} AND perspective = #{perspective} - SELECT g.id, g.resource_id as resourceId, g.snapshot_id as snapshotId, g.format, g.version, g.perspective, g.root_vertex_id as rootVertexId, g.data FROM graphs g, snapshots s WHERE g.perspective = #{perspective} AND g.snapshot_id=s.id AND s.islast=${_true} and s.project_id=( @@ -17,7 +17,7 @@ ) - + insert into graphs (resource_id, snapshot_id, format, version, perspective, root_vertex_id, data, created_at, updated_at) values ( diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/ActionPlanMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/ActionPlanMapper.xml index a41db485e48..1d770735304 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/ActionPlanMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/ActionPlanMapper.xml @@ -18,7 +18,7 @@ p.kee as projectKey - + INSERT INTO action_plans (kee, name, description, user_login, project_id, status, deadline, created_at, updated_at) VALUES (#{kee}, #{name}, #{description}, #{userLogin}, #{projectId}, #{status}, #{deadLine}, #{createdAt}, #{updatedAt}) diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml index 6cda9b308e5..a38c34e88ae 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml @@ -16,16 +16,16 @@ c.issue_change_creation_date as issueChangeCreationDate - + INSERT INTO issue_changes (kee, issue_key, user_login, change_type, change_data, created_at, updated_at, issue_change_creation_date) VALUES (#{kee}, #{issueKey}, #{userLogin}, #{changeType}, #{changeData}, #{createdAt}, #{updatedAt}, #{issueChangeCreationDate}) - + delete from issue_changes where kee=#{id} - + update issue_changes set change_data=#{changeData}, updated_at=#{updatedAt} where kee=#{kee} diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterFavouriteMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterFavouriteMapper.xml index dc774b63048..8f6ca9fef93 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterFavouriteMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterFavouriteMapper.xml @@ -28,11 +28,11 @@ VALUES (#{userLogin}, #{issueFilterId}, current_timestamp) - + delete from issue_filter_favourites where id=#{id} - + delete from issue_filter_favourites where issue_filter_id=#{issueFilterId} diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml index 2f2cf4980b2..078620f535b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml @@ -40,12 +40,12 @@ where filters.shared=${_true} - + INSERT INTO issue_filters (name, user_login, shared, description, data, created_at, updated_at) VALUES (#{name}, #{userLogin}, #{shared}, #{description}, #{data}, #{createdAt}, #{updatedAt}) - + update issue_filters set name=#{name}, shared=#{shared}, @@ -56,7 +56,7 @@ where id=#{id} - + delete from issue_filters where id=#{id} diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml index 2c4ef44b041..2e26a8c6799 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml @@ -60,7 +60,7 @@ - + INSERT INTO issues (kee, component_id, root_component_id, rule_id, action_plan_key, severity, manual_severity, message, line, effort_to_fix, technical_debt, status, resolution, checksum, reporter, assignee, author_login, issue_attributes, issue_creation_date, issue_update_date, @@ -74,7 +74,7 @@ - + update issues set action_plan_key=#{actionPlanKey}, severity=#{severity}, @@ -101,7 +101,7 @@ - + update issues set action_plan_key=#{actionPlanKey}, severity=#{severity}, @@ -135,7 +135,7 @@ where i.kee=#{kee} - select i.id, i.kee as kee, diff --git a/sonar-core/src/main/resources/org/sonar/core/measure/db/MeasureFilterMapper.xml b/sonar-core/src/main/resources/org/sonar/core/measure/db/MeasureFilterMapper.xml index 6a762f01ffd..0ed22491088 100644 --- a/sonar-core/src/main/resources/org/sonar/core/measure/db/MeasureFilterMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/measure/db/MeasureFilterMapper.xml @@ -3,12 +3,12 @@ - select id, name, user_id as "userId", shared, description, data, created_at as "createdAt", updated_at as "updatedAt" from measure_filters WHERE user_id is null and name=#{id} - + INSERT INTO measure_filters (name, user_id, shared, description, data, created_at, updated_at) VALUES (#{name}, #{userId}, #{shared}, #{description}, #{data}, #{createdAt}, #{updatedAt}) diff --git a/sonar-core/src/main/resources/org/sonar/core/notification/db/NotificationQueueMapper.xml b/sonar-core/src/main/resources/org/sonar/core/notification/db/NotificationQueueMapper.xml index ce373be4106..d1dbc9b0875 100644 --- a/sonar-core/src/main/resources/org/sonar/core/notification/db/NotificationQueueMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/notification/db/NotificationQueueMapper.xml @@ -4,20 +4,20 @@ - + INSERT INTO notifications (data) VALUES (#{data}) - + delete from notifications where id=#{id} - select count(*) from notifications - select id, data from notifications order by id asc @@ -25,14 +25,14 @@ - select top (#{count}) id, data from notifications order by id asc - select * from (select id, data from notifications diff --git a/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml b/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml index 70c9ffb08e0..7791fb0aa89 100644 --- a/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml @@ -3,45 +3,45 @@ - + INSERT INTO permission_templates (name, kee, description, key_pattern, created_at, updated_at) VALUES (#{name}, #{kee}, #{description}, #{keyPattern}, #{createdAt}, #{updatedAt}) - + UPDATE permission_templates SET name = #{name}, description = #{description}, key_pattern = #{keyPattern}, updated_at = #{updatedAt} WHERE id = #{id} - + DELETE FROM permission_templates WHERE id = #{templateId} - + DELETE FROM perm_templates_users WHERE template_id = #{templateId} - + DELETE FROM perm_templates_groups WHERE template_id = #{templateId} - + INSERT INTO perm_templates_users (template_id, user_id, permission_reference, created_at, updated_at) VALUES (#{templateId}, #{userId}, #{permission}, #{createdAt}, #{updatedAt}) - + DELETE FROM perm_templates_users WHERE template_id = #{templateId} AND user_id = #{userId} AND permission_reference = #{permission} - + INSERT INTO perm_templates_groups (template_id, group_id, permission_reference, created_at, updated_at) VALUES (#{templateId}, #{groupId}, #{permission}, #{createdAt}, #{updatedAt}) @@ -108,18 +108,18 @@ ORDER BY groups.name - SELECT id, name, kee, description, key_pattern AS keyPattern, created_at AS createdAt, updated_at AS updatedAt FROM permission_templates WHERE kee = #{kee} - SELECT id, name, kee, description, key_pattern AS keyPattern, created_at AS createdAt, updated_at AS updatedAt FROM permission_templates - SELECT pt.id AS template_id, pt.name AS template_name, pt.description AS template_description, @@ -137,7 +137,7 @@ WHERE pt.kee = #{templateKey} - SELECT pt.id AS template_id, pt.name AS template_name, pt.description AS template_description, diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/SchemaMigrationMapper.xml b/sonar-core/src/main/resources/org/sonar/core/persistence/SchemaMigrationMapper.xml index be1da205bec..2df5fc4b400 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/SchemaMigrationMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/SchemaMigrationMapper.xml @@ -3,7 +3,7 @@ - select * from schema_migrations diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml b/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml index f4efc01f985..bdd0d86a85d 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/SemaphoreMapper.xml @@ -3,16 +3,16 @@ - + INSERT INTO semaphores (name, checksum, created_at, updated_at, locked_at) VALUES (#{name}, #{checksum}, current_timestamp, current_timestamp, #{lockedAt}) - select current_timestamp - select current_timestamp from dual @@ -25,16 +25,16 @@ - + delete from semaphores where name=#{id} - select s.id, s.name as name, s.locked_at as lockedAt, s.created_at as createdAt, s.updated_at as updatedAt from semaphores s where s.name=#{name} - + update semaphores set updated_at = current_timestamp where name=#{name} diff --git a/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml b/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml index 8e1f1645409..250b49a361b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml @@ -27,13 +27,13 @@ ) - select p.id as id, p.prop_key as "key", p.text_value as value, p.resource_id as resourceId, p.user_id as userId from properties p where p.resource_id is null and p.user_id is null - select p.id as id, p.prop_key as "key", p.text_value as value, p.resource_id as resourceId, p.user_id as userId from properties p, projects r where p.resource_id=r.id and p.user_id is null and r.kee=#{id} @@ -80,20 +80,20 @@ - + update properties set text_value = #{value} where id = #{id} - + INSERT INTO properties (prop_key, resource_id, user_id, text_value) VALUES (#{key}, #{resourceId}, #{userId}, #{value}) - + delete from properties where prop_key=#{key} and resource_id=#{rId} and user_id is null - + DELETE FROM properties WHERE prop_key=#{key} @@ -102,23 +102,23 @@ AND user_id IS NULL - + delete from properties where prop_key=#{id} and resource_id is null and user_id is null - + delete from properties where resource_id is null and user_id is null - + delete from properties where prop_key=#{id} - + update properties set prop_key=#{newKey} where prop_key=#{oldKey} - + update properties set text_value=#{newValue} where text_value LIKE #{oldValue} and prop_key=#{key} diff --git a/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateConditionMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateConditionMapper.xml index 600d7ac593e..d4170d89d0f 100644 --- a/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateConditionMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateConditionMapper.xml @@ -3,7 +3,7 @@ - + insert into quality_gate_conditions (qgate_id, metric_id, operator, value_error, value_warning, period, created_at, updated_at) values (#{qualityGateId}, #{metricId}, #{operator}, #{errorThreshold}, #{warningThreshold}, #{period}, #{createdAt}, #{updatedAt}) @@ -22,11 +22,11 @@ select from quality_gate_conditions where id=#{id} - + delete from quality_gate_conditions where id=#{id} - + update quality_gate_conditions set metric_id=#{metricId}, operator=#{operator}, @@ -37,7 +37,7 @@ where id=#{id} - + delete from quality_gate_conditions where metric_id not in (select id from metrics where enabled=${_true}) diff --git a/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateMapper.xml index 84644a0a6e0..f54a4a8414b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/qualitygate/db/QualityGateMapper.xml @@ -3,7 +3,7 @@ - + insert into quality_gates (name, created_at, updated_at) values (#{name}, #{createdAt}, #{updatedAt}) @@ -27,11 +27,11 @@ where id=#{id} - + delete from quality_gates where id=#{id} - + update quality_gates set name=#{name}, updated_at=#{updatedAt} diff --git a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml index 2f31335b5fd..63c868f2097 100644 --- a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml @@ -66,7 +66,7 @@ WHERE id=#{id} - + DELETE FROM active_rules WHERE id=#{id} diff --git a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml index e6ad1eaf7c8..84c2ae5e101 100644 --- a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml @@ -14,12 +14,12 @@ p.rules_updated_at as rulesUpdatedAt - + INSERT INTO rules_profiles (kee, parent_kee, name, language, created_at, updated_at, rules_updated_at) VALUES (#{kee}, #{parentKee}, #{name}, #{language}, #{createdAt}, #{updatedAt}, #{rulesUpdatedAt,}) - + UPDATE rules_profiles SET name=#{name}, language=#{language}, @@ -29,7 +29,7 @@ WHERE id=#{id} - + DELETE FROM rules_profiles WHERE id=#{id} diff --git a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml index 9dc93cb8295..f32095b71da 100644 --- a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml @@ -156,7 +156,7 @@ - select rootProject.* from snapshots s inner join projects rootProject on rootProject.id=s.root_project_id @@ -235,7 +235,7 @@ - select p.* from projects p left join snapshots s on s.project_id=p.id where s.id is null @@ -289,7 +289,7 @@ - + insert into projects (name, long_name, description, scope, qualifier, kee, deprecated_kee, path, language, root_id, copy_resource_id, person_id, enabled, created_at) values ( @@ -299,7 +299,7 @@ ) - + update projects set name=#{name}, long_name=#{longName}, description=#{description}, scope=#{scope}, qualifier=#{qualifier}, kee=#{key}, deprecated_kee=#{deprecatedKey}, path=#{path}, language=#{language}, root_id=#{rootId}, copy_resource_id=#{copyResourceId}, diff --git a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml index 7fba3960e6e..37a8815edf0 100644 --- a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml @@ -124,7 +124,7 @@ #{noteUpdatedAt}, #{createdAt}, #{updatedAt}) - + delete from active_rule_parameters where rules_parameter_id=#{id} @@ -159,16 +159,16 @@ WHERE p.rule_id=#{ruleId} AND p.name=#{key} - + delete from rules_parameters where id=#{id} - + INSERT INTO rules_parameters (rule_id, name, param_type, default_value, description) VALUES (#{ruleId}, #{name}, #{type}, #{defaultValue}, #{description}) - + UPDATE rules_parameters SET param_type=#{type}, default_value=#{defaultValue}, @@ -176,7 +176,7 @@ WHERE id=#{id} - SELECT r.plugin_name as "repoField", r.plugin_rule_key as "ruleField" FROM rules r WHERE r.updated_at IS NULL or r.updated_at >= #{id} diff --git a/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml b/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml index 152832e0366..713a095a03d 100644 --- a/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml @@ -95,7 +95,7 @@ VALUES (#{kee}, #{name}, #{parentId}, #{characteristicOrder}, #{enabled}, #{createdAt}, #{updatedAt}) - + update characteristics set name=#{name}, parent_id=#{parentId}, @@ -105,7 +105,7 @@ where id=#{id} - select id as "id", parent_id as "parentId", root_id as "rootId", @@ -120,7 +120,7 @@ where rule_id IS NOT NULL - + DELETE FROM characteristics WHERE rule_id IS NOT NULL diff --git a/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml b/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml index 1a347fa53dd..f4d03658b08 100644 --- a/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/user/AuthorMapper.xml @@ -3,17 +3,17 @@ - SELECT id, person_id AS personId, login, created_at AS createdAt, updated_at AS updatedAt FROM authors WHERE login=#{id} - SELECT count(id) FROM authors WHERE person_id=#{id} - + INSERT INTO authors (person_id, login, created_at, updated_at) VALUES (#{personId}, #{login}, #{createdAt}, #{updatedAt}) diff --git a/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml index 8d81b2ccc52..ad7a4b02f21 100644 --- a/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml @@ -46,12 +46,12 @@ - + INSERT INTO group_roles (group_id, resource_id, role) VALUES (#{groupId}, #{resourceId}, #{role}) - + INSERT INTO user_roles (user_id, resource_id, role) VALUES (#{userId}, #{resourceId}, #{role}) -- 2.39.5