]> source.dussan.org Git - sonarqube.git/commitdiff
refactoring - use select in method names in ComponentDao
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 19 May 2015 09:11:46 +0000 (11:11 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 19 May 2015 09:11:46 +0000 (11:11 +0200)
32 files changed:
server/sonar-server/src/main/java/org/sonar/server/batch/IssuesAction.java
server/sonar-server/src/main/java/org/sonar/server/batch/ProjectRepositoryLoader.java
server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java
server/sonar-server/src/main/java/org/sonar/server/component/db/ComponentDao.java
server/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentAppAction.java
server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/design/ws/ShowAction.java
server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsJsonWriter.java
server/sonar-server/src/main/java/org/sonar/server/duplication/ws/ShowAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java
server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotification.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueShowAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/QualityGates.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectOperations.java
server/sonar-server/src/main/java/org/sonar/server/source/ws/LinesAction.java
server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsCoveredFilesAction.java
server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsListAction.java
server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentNavigationAction.java
server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsJsonWriterTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/ShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java
server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsCoveredFilesActionTest.java
sonar-batch/src/test/java/org/sonar/batch/index/ResourcePersisterTest.java
sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml

index a710e2a2e25252da43d5d9338b97818b5f7cca25..9290df18a267f1c4435cbfcfe7b4f7cda167ef05 100644 (file)
@@ -145,7 +145,7 @@ public class IssuesAction implements BatchWsAction {
       if (moduleUuid == null) {
         throw new IllegalArgumentException(String.format("The component '%s' has no module uuid", component.uuid()));
       }
-      ComponentDto module = dbClient.componentDao().getByUuid(session, moduleUuid);
+      ComponentDto module = dbClient.componentDao().selectByUuid(session, moduleUuid);
       keysByUUid.put(module.uuid(), module.key());
     }
     return keysByUUid;
index 573db15d4cb40b1a6ea5e8c01d778d9fb2525e53..dda6f2e72e037d5560eb79dcfe74ad310237ae2e 100644 (file)
@@ -140,7 +140,7 @@ public class ProjectRepositoryLoader {
 
   private ComponentDto getProject(ComponentDto module, DbSession session) {
     if (!module.isRootProject()) {
-      return dbClient.componentDao().getNullableByUuid(session, module.projectUuid());
+      return dbClient.componentDao().selectNullableByUuid(session, module.projectUuid());
     } else {
       return module;
     }
@@ -161,7 +161,7 @@ public class ProjectRepositoryLoader {
   private void aggregateParentModules(ComponentDto component, List<ComponentDto> parents, DbSession session) {
     String moduleUuid = component.moduleUuid();
     if (moduleUuid != null) {
-      ComponentDto parent = dbClient.componentDao().getByUuid(session, moduleUuid);
+      ComponentDto parent = dbClient.componentDao().selectByUuid(session, moduleUuid);
       if (parent != null) {
         parents.add(parent);
         aggregateParentModules(parent, parents, session);
index 287f72738a273469bf97c6c8ac50fed253271551..d3418f826216237fd341d00d47ceefec2df59c29 100644 (file)
@@ -99,7 +99,7 @@ public class ComponentService {
   public ComponentDto getByUuid(String uuid) {
     DbSession session = dbClient.openSession(false);
     try {
-      return dbClient.componentDao().getByUuid(session, uuid);
+      return dbClient.componentDao().selectByUuid(session, uuid);
     } finally {
       session.close();
     }
@@ -109,7 +109,7 @@ public class ComponentService {
   public ComponentDto getNullableByUuid(String uuid) {
     DbSession session = dbClient.openSession(false);
     try {
-      return dbClient.componentDao().getNullableByUuid(session, uuid);
+      return dbClient.componentDao().selectNullableByUuid(session, uuid);
     } finally {
       session.close();
     }
@@ -229,7 +229,7 @@ public class ComponentService {
   public Set<String> getDistinctQualifiers(DbSession session, @Nullable Collection<String> componentUuids) {
     Set<String> componentQualifiers = Sets.newHashSet();
     if (componentUuids != null && !componentUuids.isEmpty()) {
-      List<ComponentDto> components = dbClient.componentDao().getByUuids(session, componentUuids);
+      List<ComponentDto> components = dbClient.componentDao().selectByUuids(session, componentUuids);
 
       for (ComponentDto component : components) {
         componentQualifiers.add(component.qualifier());
@@ -241,7 +241,7 @@ public class ComponentService {
   public Collection<ComponentDto> getByUuids(DbSession session, Collection<String> componentUuids) {
     Set<ComponentDto> directoryPaths = Sets.newHashSet();
     if (componentUuids != null && !componentUuids.isEmpty()) {
-      List<ComponentDto> components = dbClient.componentDao().getByUuids(session, componentUuids);
+      List<ComponentDto> components = dbClient.componentDao().selectByUuids(session, componentUuids);
 
       for (ComponentDto component : components) {
         directoryPaths.add(component);
index 497961498f600503b28d451f3376cb6dc1e094e4..1251de531319e941d726461398adda7e223fc53c 100644 (file)
@@ -52,8 +52,8 @@ import static com.google.common.collect.Maps.newHashMapWithExpectedSize;
 @ServerSide
 public class ComponentDao implements DaoComponent {
 
-  public ComponentDto getById(Long id, DbSession session) {
-    ComponentDto componentDto = getNullableById(id, session);
+  public ComponentDto selectById(Long id, DbSession session) {
+    ComponentDto componentDto = selectNullableById(id, session);
     if (componentDto == null) {
       throw new NotFoundException(String.format("Project with id '%s' not found", id));
     }
@@ -61,17 +61,17 @@ public class ComponentDao implements DaoComponent {
   }
 
   @CheckForNull
-  public ComponentDto getNullableById(Long id, DbSession session) {
+  public ComponentDto selectNullableById(Long id, DbSession session) {
     return mapper(session).selectById(id);
   }
 
   @CheckForNull
-  public ComponentDto getNullableByUuid(DbSession session, String uuid) {
+  public ComponentDto selectNullableByUuid(DbSession session, String uuid) {
     return mapper(session).selectByUuid(uuid);
   }
 
-  public ComponentDto getByUuid(DbSession session, String uuid) {
-    ComponentDto componentDto = getNullableByUuid(session, uuid);
+  public ComponentDto selectByUuid(DbSession session, String uuid) {
+    ComponentDto componentDto = selectNullableByUuid(session, uuid);
     if (componentDto == null) {
       throw new NotFoundException(String.format("Component with uuid '%s' not found", uuid));
     }
@@ -82,15 +82,15 @@ public class ComponentDao implements DaoComponent {
     return mapper(session).countById(id) > 0;
   }
 
-  public List<ComponentDto> findModulesByProject(String projectKey, DbSession session) {
-    return mapper(session).findModulesByProject(projectKey);
+  public List<ComponentDto> selectModulesByProject(String projectKey, DbSession session) {
+    return mapper(session).selectModulesByProject(projectKey);
   }
 
-  public List<ComponentDto> findSubProjectsByComponentUuids(DbSession session, Collection<String> keys) {
+  public List<ComponentDto> selectSubProjectsByComponentUuids(DbSession session, Collection<String> keys) {
     if (keys.isEmpty()) {
       return Collections.emptyList();
     }
-    return mapper(session).findSubProjectsByComponentUuids(keys);
+    return mapper(session).selectSubProjectsByComponentUuids(keys);
   }
 
   public List<ComponentDto> selectDescendantModules(DbSession session, String rootComponentUuid) {
@@ -109,20 +109,20 @@ public class ComponentDao implements DaoComponent {
     return mapper(session).selectEnabledFilesFromProject(rootComponentUuid);
   }
 
-  public List<ComponentDto> getByIds(final DbSession session, Collection<Long> ids) {
+  public List<ComponentDto> selectByIds(final DbSession session, Collection<Long> ids) {
     return DaoUtils.executeLargeInputs(ids, new Function<List<Long>, List<ComponentDto>>() {
       @Override
       public List<ComponentDto> apply(List<Long> partition) {
-        return mapper(session).findByIds(partition);
+        return mapper(session).selectByIds(partition);
       }
     });
   }
 
-  public List<ComponentDto> getByUuids(final DbSession session, Collection<String> uuids) {
+  public List<ComponentDto> selectByUuids(final DbSession session, Collection<String> uuids) {
     return DaoUtils.executeLargeInputs(uuids, new Function<List<String>, List<ComponentDto>>() {
       @Override
       public List<ComponentDto> apply(List<String> partition) {
-        return mapper(session).findByUuids(partition);
+        return mapper(session).selectByUuids(partition);
       }
     });
   }
@@ -137,7 +137,7 @@ public class ComponentDao implements DaoComponent {
   }
 
   public List<ComponentDto> selectByKeys(DbSession session, Collection<String> keys) {
-    return mapper(session).findByKeys(keys);
+    return mapper(session).selectByKeys(keys);
   }
 
   public ComponentDto selectByKey(DbSession session, String key) {
@@ -167,8 +167,8 @@ public class ComponentDao implements DaoComponent {
     insert(session, Lists.asList(item, others));
   }
 
-  public List<String> findProjectUuids(DbSession session) {
-    return mapper(session).findProjectUuids();
+  public List<String> selectProjectUuids(DbSession session) {
+    return mapper(session).selectProjectUuids();
   }
 
   public List<UuidWithProjectUuidDto> selectAllViewsAndSubViews(DbSession session) {
index 8566ea5848cf5c72959f5619cb068bedf666309f..85c835d9cdbed1f0d6a924afe963c9e40d810a76 100644 (file)
@@ -98,7 +98,7 @@ public class ComponentAppAction implements RequestHandler {
 
     DbSession session = dbClient.openSession(false);
     try {
-      ComponentDto component = dbClient.componentDao().getNullableByUuid(session, componentUuid);
+      ComponentDto component = dbClient.componentDao().selectNullableByUuid(session, componentUuid);
       if (component == null) {
         throw new NotFoundException(String.format("Component '%s' does not exist", componentUuid));
       }
@@ -135,7 +135,7 @@ public class ComponentAppAction implements RequestHandler {
     json.prop("q", component.qualifier());
 
     ComponentDto parentProject = nullableComponentById(component.parentProjectId(), session);
-    ComponentDto project = dbClient.componentDao().getByUuid(session, component.projectUuid());
+    ComponentDto project = dbClient.componentDao().selectByUuid(session, component.projectUuid());
 
     // Do not display parent project if parent project and project are the same
     boolean displayParentProject = parentProject != null && !parentProject.getId().equals(project.getId());
@@ -191,7 +191,7 @@ public class ComponentAppAction implements RequestHandler {
   @CheckForNull
   private ComponentDto nullableComponentById(@Nullable Long componentId, DbSession session) {
     if (componentId != null) {
-      return dbClient.componentDao().getById(componentId, session);
+      return dbClient.componentDao().selectById(componentId, session);
     }
     return null;
   }
index 1ba691ccae62a479fcd29366a0be5ed81350dc11..1d1256f9af3aa006a4002ce684248aee3029fe50 100644 (file)
@@ -91,7 +91,7 @@ public class SearchAction implements RequestHandler {
 
     DbSession session = dbClient.openSession(false);
     try {
-      ComponentDto componentDto = dbClient.componentDao().getByUuid(session, viewOrSubUuid);
+      ComponentDto componentDto = dbClient.componentDao().selectByUuid(session, viewOrSubUuid);
       userSession.checkProjectUuidPermission(UserRole.USER, componentDto.projectUuid());
 
       Set<Long> projectIds = newLinkedHashSet(dbClient.componentIndexDao().selectProjectIdsFromQueryAndViewOrSubViewUuid(session, query, componentDto.uuid()));
@@ -101,7 +101,7 @@ public class SearchAction implements RequestHandler {
       options.setPage(request.mandatoryParamAsInt(PAGE), request.mandatoryParamAsInt(PAGE_SIZE));
       Set<Long> pagedProjectIds = pagedProjectIds(authorizedProjectIds, options);
 
-      List<ComponentDto> projects = dbClient.componentDao().getByIds(session, pagedProjectIds);
+      List<ComponentDto> projects = dbClient.componentDao().selectByIds(session, pagedProjectIds);
 
       options.writeJson(json, authorizedProjectIds.size());
       json.name("components").beginArray();
index 2c5f3203ff47f540a9d0e19ce71c5c2c6cd29cbd..1412bc5a4200e70c2380b947672325ff6b3479a1 100644 (file)
@@ -78,8 +78,8 @@ public class ShowAction implements UsersWsAction {
 
     DbSession session = dbClient.openSession(false);
     try {
-      ComponentDto fromParent = dbClient.componentDao().getByUuid(session, fromParentUuid);
-      ComponentDto project = dbClient.componentDao().getByUuid(session, fromParent.projectUuid());
+      ComponentDto fromParent = dbClient.componentDao().selectByUuid(session, fromParentUuid);
+      ComponentDto project = dbClient.componentDao().selectByUuid(session, fromParent.projectUuid());
       userSession.checkProjectUuidPermission(UserRole.USER, project.uuid());
 
       List<FileDependencyDto> fileDependencies = dbClient.fileDependencyDao().selectFromParents(session, fromParentUuid, toParentUuid, project.getId());
@@ -113,7 +113,7 @@ public class ShowAction implements UsersWsAction {
       uuids.add(fileDependency.getToComponentUuid());
     }
     Map<String, ComponentDto> componentsByUuid = new HashMap<>();
-    for (ComponentDto componentDto : dbClient.componentDao().getByUuids(session, uuids)) {
+    for (ComponentDto componentDto : dbClient.componentDao().selectByUuids(session, uuids)) {
       componentsByUuid.put(componentDto.uuid(), componentDto);
     }
     return componentsByUuid;
index 71d062cac167718a6d07511752713a9951a0986f..b4e615d028ba3defeb4f3145f47618339636d67e 100644 (file)
@@ -129,7 +129,7 @@ public class DuplicationsJsonWriter {
   private ComponentDto getProject(String projectUuid, Map<String, ComponentDto> projectsByUuid, DbSession session) {
     ComponentDto project = projectsByUuid.get(projectUuid);
     if (project == null) {
-      project = componentDao.getNullableByUuid(session, projectUuid);
+      project = componentDao.selectNullableByUuid(session, projectUuid);
       if (project != null) {
         projectsByUuid.put(project.uuid(), project);
       }
@@ -140,7 +140,7 @@ public class DuplicationsJsonWriter {
   private ComponentDto getParentProject(@Nullable Long projectId, Map<Long, ComponentDto> subProjectsById, DbSession session) {
     ComponentDto project = subProjectsById.get(projectId);
     if (project == null && projectId != null) {
-      project = componentDao.getNullableById(projectId, session);
+      project = componentDao.selectNullableById(projectId, session);
       if (project != null) {
         subProjectsById.put(project.getId(), project);
       }
index f270db6220fe3126d7f58473df07f7196b19ad0d..41f0d5a550a84014235ee3492d4a6f5d2c0ee84c 100644 (file)
@@ -88,7 +88,7 @@ public class ShowAction implements RequestHandler {
 
     DbSession session = dbClient.openSession(false);
     if (fileKey == null) {
-      fileKey = componentDao.getByUuid(session, fileUuid).key();
+      fileKey = componentDao.selectByUuid(session, fileUuid).key();
     }
 
     userSession.checkComponentPermission(UserRole.CODEVIEWER, fileKey);
index f6923d6fa76041386e61efd6b52bec7fd1bcc6c6..59bc7e03127ef7583398f440757ea1613f85949b 100644 (file)
@@ -351,7 +351,7 @@ public class IssueQueryService {
   }
 
   private void addDeveloperTechnicalProjects(IssueQuery.Builder builder, DbSession session, Collection<String> componentUuids, Collection<String> authors) {
-    Collection<ComponentDto> technicalProjects = dbClient.componentDao().getByUuids(session, componentUuids);
+    Collection<ComponentDto> technicalProjects = dbClient.componentDao().selectByUuids(session, componentUuids);
     Collection<String> developerUuids = Collections2.transform(technicalProjects, new Function<ComponentDto, String>() {
       @Override
       public String apply(ComponentDto input) {
@@ -366,7 +366,7 @@ public class IssueQueryService {
         return input.getCopyResourceId();
       }
     });
-    List<ComponentDto> originalProjects = dbClient.componentDao().getByIds(session, projectIds);
+    List<ComponentDto> originalProjects = dbClient.componentDao().selectByIds(session, projectIds);
     Collection<String> projectUuids = Collections2.transform(originalProjects, new Function<ComponentDto, String>() {
       @Override
       public String apply(ComponentDto input) {
index 6fd1351f76139e22e492e7a97c56ddad88b83364..2d46062b578567262604dfb287502ff6135518cd 100644 (file)
@@ -247,7 +247,7 @@ public class IssueService {
     DbSession session = dbClient.openSession(false);
     try {
       ComponentDto component = dbClient.componentDao().selectByKey(session, componentKey);
-      ComponentDto project = dbClient.componentDao().getByUuid(session, component.projectUuid());
+      ComponentDto project = dbClient.componentDao().selectByUuid(session, component.projectUuid());
 
       userSession.checkProjectPermission(UserRole.USER, project.getKey());
       if (!ruleKey.isManual()) {
index bafb6daf244dd167818340f83058052cf00f3af4..b89e9696da407526bd1e1043e5e3c3fa49b1cdfb 100644 (file)
@@ -115,7 +115,7 @@ public class NewIssuesNotification extends Notification {
     try {
       for (int i = 0; i < 5 && i < componentStats.size(); i++) {
         String uuid = componentStats.get(i).getElement();
-        String componentName = dbClient.componentDao().getByUuid(dbSession, uuid).name();
+        String componentName = dbClient.componentDao().selectByUuid(dbSession, uuid).name();
         setFieldValue(metric + DOT + (i + 1) + LABEL, componentName);
         setFieldValue(metric + DOT + (i + 1) + COUNT, String.valueOf(componentStats.get(i).getCount()));
       }
index cce3de4defe89ffad8cd83a0d8e1dadf4c3a0531..2e730160aa4527dae9bf7c2fbec6bafdf73d7668 100644 (file)
@@ -166,10 +166,10 @@ public class IssueShowAction implements IssuesWsAction {
   }
 
   private void addComponents(DbSession session, Issue issue, JsonWriter json) {
-    ComponentDto component = dbClient.componentDao().getByUuid(session, issue.componentUuid());
+    ComponentDto component = dbClient.componentDao().selectByUuid(session, issue.componentUuid());
     Long parentProjectId = component.parentProjectId();
-    ComponentDto parentProject = parentProjectId != null ? dbClient.componentDao().getNullableById(parentProjectId, session) : null;
-    ComponentDto project = dbClient.componentDao().getByUuid(session, component.projectUuid());
+    ComponentDto parentProject = parentProjectId != null ? dbClient.componentDao().selectNullableById(parentProjectId, session) : null;
+    ComponentDto project = dbClient.componentDao().selectByUuid(session, component.projectUuid());
 
     String projectName = project.longName() != null ? project.longName() : project.name();
     // Do not display sub project long name if sub project and project are the same
index c0069644ae21dd715c83da547f4d4fc47822ab31..167c4ff8d33d5c75683c175d8d4bd38998b5029d 100644 (file)
@@ -357,15 +357,15 @@ public class SearchAction implements IssuesWsAction {
       }
       usersByLogin = getUsersByLogin(userLogins);
 
-      List<ComponentDto> fileDtos = dbClient.componentDao().getByUuids(session, componentUuids);
-      List<ComponentDto> subProjectDtos = dbClient.componentDao().findSubProjectsByComponentUuids(session, componentUuids);
+      List<ComponentDto> fileDtos = dbClient.componentDao().selectByUuids(session, componentUuids);
+      List<ComponentDto> subProjectDtos = dbClient.componentDao().selectSubProjectsByComponentUuids(session, componentUuids);
       componentDtos.addAll(fileDtos);
       componentDtos.addAll(subProjectDtos);
       for (ComponentDto component : componentDtos) {
         projectUuids.add(component.projectUuid());
       }
 
-      List<ComponentDto> projectDtos = dbClient.componentDao().getByUuids(session, projectUuids);
+      List<ComponentDto> projectDtos = dbClient.componentDao().selectByUuids(session, projectUuids);
       componentDtos.addAll(projectDtos);
       for (ComponentDto componentDto : componentDtos) {
         componentsByUuid.put(componentDto.uuid(), componentDto);
index fe9015d3c1a2bd4da06b9859fd1902364579096a..e526d1a92e43005a70153067e89b5ac08a6c70fe 100644 (file)
@@ -363,7 +363,7 @@ public class QualityGates {
   }
 
   private void checkPermission(Long projectId, DbSession session) {
-    ComponentDto project = componentDao.getById(projectId, session);
+    ComponentDto project = componentDao.selectById(projectId, session);
     if (!userSession.hasGlobalPermission(GlobalPermissions.QUALITY_PROFILE_ADMIN) && !userSession.hasProjectPermission(UserRole.ADMIN, project.key())) {
       throw new ForbiddenException("Insufficient privileges");
     }
index 4f6041cd55eaa83b4a741e7cac8267788bbda989..0e0bb228059770a6565af2a424152db408082c5d 100644 (file)
@@ -55,7 +55,7 @@ public class QProfileProjectOperations {
   }
 
   void addProject(String profileKey, String projectUuid, UserSession userSession, DbSession session) {
-    ComponentDto project = db.componentDao().getByUuid(session, projectUuid);
+    ComponentDto project = db.componentDao().selectByUuid(session, projectUuid);
     checkPermission(userSession, project.key());
     QualityProfileDto qualityProfile = findNotNull(profileKey, session);
 
@@ -77,7 +77,7 @@ public class QProfileProjectOperations {
   public void removeProject(String profileKey, String projectUuid, UserSession userSession) {
     DbSession session = db.openSession(false);
     try {
-      ComponentDto project = db.componentDao().getByUuid(session, projectUuid);
+      ComponentDto project = db.componentDao().selectByUuid(session, projectUuid);
       checkPermission(userSession, project.key());
       QualityProfileDto qualityProfile = findNotNull(profileKey, session);
 
@@ -91,7 +91,7 @@ public class QProfileProjectOperations {
   public void removeProject(String language, long projectId, UserSession userSession) {
     DbSession session = db.openSession(false);
     try {
-      ComponentDto project = db.componentDao().getById(projectId, session);
+      ComponentDto project = db.componentDao().selectById(projectId, session);
       checkPermission(userSession, project.key());
 
       QualityProfileDto associatedProfile = db.qualityProfileDao().getByProjectAndLanguage(project.getKey(), language, session);
index 0834e31a3a8df9f18126c21e3fd1bc17b4dabd56..07dcf6eb811a39dfbee423de26eab52e0f62d4af 100644 (file)
@@ -150,7 +150,7 @@ public class LinesAction implements SourcesWsAction {
     try {
       String fileUuid = request.param(PARAM_UUID);
       if (fileUuid != null) {
-        return dbClient.componentDao().getByUuid(session, fileUuid);
+        return dbClient.componentDao().selectByUuid(session, fileUuid);
       }
       String fileKey = request.param(PARAM_KEY);
       if (fileKey != null) {
index 403fded577b3ab58e63b37db7cdff10a4a8843c5..50c87eaaf51990851bcc0816ebead70e18f8b897 100644 (file)
@@ -105,7 +105,7 @@ public class TestsCoveredFilesAction implements TestsWsAction {
     DbSession dbSession = dbClient.openSession(false);
     List<ComponentDto> components;
     try {
-      components = dbClient.componentDao().getByUuids(dbSession, sourceFileUuids);
+      components = dbClient.componentDao().selectByUuids(dbSession, sourceFileUuids);
     } finally {
       MyBatis.closeQuietly(dbSession);
     }
index 2625d09fe8898df55e810993a226ccfb6976214e..f74b34f87c5b3b172b69eea3528389fb86300dad 100644 (file)
@@ -170,7 +170,7 @@ public class TestsListAction implements TestsWsAction {
         return testDoc.fileUuid();
       }
     });
-    List<ComponentDto> components = dbClient.componentDao().getByUuids(dbSession, fileUuids);
+    List<ComponentDto> components = dbClient.componentDao().selectByUuids(dbSession, fileUuids);
 
     return Maps.uniqueIndex(components, new NonNullInputFunction<ComponentDto, String>() {
       @Override
@@ -223,7 +223,7 @@ public class TestsListAction implements TestsWsAction {
   }
 
   private void checkComponentUuidPermission(DbSession dbSession, String componentUuid) {
-    ComponentDto component = dbClient.componentDao().getByUuid(dbSession, componentUuid);
+    ComponentDto component = dbClient.componentDao().selectByUuid(dbSession, componentUuid);
     userSession.checkProjectUuidPermission(UserRole.CODEVIEWER, component.projectUuid());
   }
 }
index 83cdb3b6c59cf6329e51759b8b9db060f8d8ab87..b6c55407894c575c37b2ff768574b56240acf315 100644 (file)
@@ -262,7 +262,7 @@ public class ComponentNavigationAction implements NavigationWsAction {
       SnapshotDto currentSnapshot = snapshot;
       while (currentSnapshot.getParentId() != null) {
         currentSnapshot = dbClient.snapshotDao().getByKey(session, currentSnapshot.getParentId());
-        componentPath.add(0, dbClient.componentDao().getById(currentSnapshot.getResourceId(), session));
+        componentPath.add(0, dbClient.componentDao().selectById(currentSnapshot.getResourceId(), session));
       }
     }
 
index 97794b91439bd58b0f520d4e1f15ea1578b523c8..aa55b64387f1748cb4b1188a9b8391b8760faf98 100644 (file)
@@ -66,7 +66,7 @@ public class ComponentDaoTest {
   public void get_by_uuid() {
     loadBasicDataInDatabase();
 
-    ComponentDto result = sut.getNullableByUuid(session, "KLMN");
+    ComponentDto result = sut.selectNullableByUuid(session, "KLMN");
     assertThat(result).isNotNull();
     assertThat(result.uuid()).isEqualTo("KLMN");
     assertThat(result.moduleUuid()).isEqualTo("EFGH");
@@ -91,7 +91,7 @@ public class ComponentDaoTest {
   public void get_by_uuid_on_technical_project_copy() {
     loadBasicDataInDatabase();
 
-    ComponentDto result = sut.getNullableByUuid(session, "STUV");
+    ComponentDto result = sut.selectNullableByUuid(session, "STUV");
     assertThat(result).isNotNull();
     assertThat(result.uuid()).isEqualTo("STUV");
     assertThat(result.moduleUuid()).isEqualTo("OPQR");
@@ -112,7 +112,7 @@ public class ComponentDaoTest {
   public void get_by_uuid_on_disabled_component() {
     loadBasicDataInDatabase();
 
-    ComponentDto result = sut.getNullableByUuid(session, "DCBA");
+    ComponentDto result = sut.selectNullableByUuid(session, "DCBA");
     assertThat(result).isNotNull();
     assertThat(result.isEnabled()).isFalse();
   }
@@ -123,7 +123,7 @@ public class ComponentDaoTest {
 
     loadBasicDataInDatabase();
 
-    sut.getByUuid(session, "unknown");
+    sut.selectByUuid(session, "unknown");
   }
 
   @Test
@@ -150,7 +150,7 @@ public class ComponentDaoTest {
 
     loadBasicDataInDatabase();
 
-    sut.getByUuid(session, "unknown");
+    sut.selectByUuid(session, "unknown");
   }
 
   @Test
@@ -205,7 +205,7 @@ public class ComponentDaoTest {
   public void get_by_ids() {
     loadBasicDataInDatabase();
 
-    List<ComponentDto> results = sut.getByIds(session, newArrayList(4L));
+    List<ComponentDto> results = sut.selectByIds(session, newArrayList(4L));
     assertThat(results).hasSize(1);
 
     ComponentDto result = results.get(0);
@@ -219,14 +219,14 @@ public class ComponentDaoTest {
     assertThat(result.language()).isEqualTo("java");
     assertThat(result.parentProjectId()).isEqualTo(2);
 
-    assertThat(sut.getByIds(session, newArrayList(555L))).isEmpty();
+    assertThat(sut.selectByIds(session, newArrayList(555L))).isEmpty();
   }
 
   @Test
   public void get_by_uuids() {
     loadBasicDataInDatabase();
 
-    List<ComponentDto> results = sut.getByUuids(session, newArrayList("KLMN"));
+    List<ComponentDto> results = sut.selectByUuids(session, newArrayList("KLMN"));
     assertThat(results).hasSize(1);
 
     ComponentDto result = results.get(0);
@@ -244,14 +244,14 @@ public class ComponentDaoTest {
     assertThat(result.scope()).isEqualTo("FIL");
     assertThat(result.language()).isEqualTo("java");
 
-    assertThat(sut.getByUuids(session, newArrayList("unknown"))).isEmpty();
+    assertThat(sut.selectByUuids(session, newArrayList("unknown"))).isEmpty();
   }
 
   @Test
   public void get_by_uuids_on_removed_components() {
     loadBasicDataInDatabase();
 
-    List<ComponentDto> results = sut.getByUuids(session, newArrayList("DCBA"));
+    List<ComponentDto> results = sut.selectByUuids(session, newArrayList("DCBA"));
     assertThat(results).hasSize(1);
 
     ComponentDto result = results.get(0);
@@ -274,14 +274,14 @@ public class ComponentDaoTest {
   public void get_by_id() {
     loadBasicDataInDatabase();
 
-    assertThat(sut.getById(4L, session)).isNotNull();
+    assertThat(sut.selectById(4L, session)).isNotNull();
   }
 
   @Test
   public void get_by_id_on_disabled_component() {
     loadBasicDataInDatabase();
 
-    ComponentDto result = sut.getNullableById(10L, session);
+    ComponentDto result = sut.selectNullableById(10L, session);
     assertThat(result).isNotNull();
     assertThat(result.isEnabled()).isFalse();
   }
@@ -290,15 +290,15 @@ public class ComponentDaoTest {
   public void fail_to_get_by_id_when_project_not_found() {
     loadBasicDataInDatabase();
 
-    sut.getById(111L, session);
+    sut.selectById(111L, session);
   }
 
   @Test
   public void get_nullable_by_id() {
     loadBasicDataInDatabase();
 
-    assertThat(sut.getNullableById(4L, session)).isNotNull();
-    assertThat(sut.getNullableById(111L, session)).isNull();
+    assertThat(sut.selectNullableById(4L, session)).isNotNull();
+    assertThat(sut.selectNullableById(111L, session)).isNull();
   }
 
   @Test
@@ -313,17 +313,17 @@ public class ComponentDaoTest {
   public void find_modules_by_project() {
     db.prepareDbUnit(getClass(), "multi-modules.xml");
 
-    List<ComponentDto> results = sut.findModulesByProject("org.struts:struts", session);
+    List<ComponentDto> results = sut.selectModulesByProject("org.struts:struts", session);
     assertThat(results).hasSize(1);
     assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts-core");
 
-    results = sut.findModulesByProject("org.struts:struts-core", session);
+    results = sut.selectModulesByProject("org.struts:struts-core", session);
     assertThat(results).hasSize(1);
     assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts-data");
 
-    assertThat(sut.findModulesByProject("org.struts:struts-data", session)).isEmpty();
+    assertThat(sut.selectModulesByProject("org.struts:struts-data", session)).isEmpty();
 
-    assertThat(sut.findModulesByProject("unknown", session)).isEmpty();
+    assertThat(sut.selectModulesByProject("unknown", session)).isEmpty();
   }
 
   @Test
@@ -331,34 +331,34 @@ public class ComponentDaoTest {
     db.prepareDbUnit(getClass(), "multi-modules.xml");
 
     // Sub project of a file
-    List<ComponentDto> results = sut.findSubProjectsByComponentUuids(session, newArrayList("HIJK"));
+    List<ComponentDto> results = sut.selectSubProjectsByComponentUuids(session, newArrayList("HIJK"));
     assertThat(results).hasSize(1);
     assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts-data");
 
     // Sub project of a directory
-    results = sut.findSubProjectsByComponentUuids(session, newArrayList("GHIJ"));
+    results = sut.selectSubProjectsByComponentUuids(session, newArrayList("GHIJ"));
     assertThat(results).hasSize(1);
     assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts-data");
 
     // Sub project of a sub module
-    results = sut.findSubProjectsByComponentUuids(session, newArrayList("FGHI"));
+    results = sut.selectSubProjectsByComponentUuids(session, newArrayList("FGHI"));
     assertThat(results).hasSize(1);
     assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts");
 
     // Sub project of a module
-    results = sut.findSubProjectsByComponentUuids(session, newArrayList("EFGH"));
+    results = sut.selectSubProjectsByComponentUuids(session, newArrayList("EFGH"));
     assertThat(results).hasSize(1);
     assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts");
 
     // Sub project of a project
-    assertThat(sut.findSubProjectsByComponentUuids(session, newArrayList("ABCD"))).isEmpty();
+    assertThat(sut.selectSubProjectsByComponentUuids(session, newArrayList("ABCD"))).isEmpty();
 
     // SUb projects of a component and a sub module
-    assertThat(sut.findSubProjectsByComponentUuids(session, newArrayList("HIJK", "FGHI"))).hasSize(2);
+    assertThat(sut.selectSubProjectsByComponentUuids(session, newArrayList("HIJK", "FGHI"))).hasSize(2);
 
-    assertThat(sut.findSubProjectsByComponentUuids(session, newArrayList("unknown"))).isEmpty();
+    assertThat(sut.selectSubProjectsByComponentUuids(session, newArrayList("unknown"))).isEmpty();
 
-    assertThat(sut.findSubProjectsByComponentUuids(session, Collections.<String>emptyList())).isEmpty();
+    assertThat(sut.selectSubProjectsByComponentUuids(session, Collections.<String>emptyList())).isEmpty();
   }
 
   @Test
@@ -516,7 +516,7 @@ public class ComponentDaoTest {
   public void find_project_uuids() {
     db.prepareDbUnit(getClass(), "find_project_uuids.xml");
 
-    assertThat(sut.findProjectUuids(session)).containsExactly("ABCD");
+    assertThat(sut.selectProjectUuids(session)).containsExactly("ABCD");
   }
 
   @Test
index 815f60ca46451712fb46229fcab11b388aff8bdc..5089d87590c66b7ec70cf596f7c7db73a8d9a0ab 100644 (file)
@@ -121,9 +121,9 @@ public class ComponentAppActionTest {
       .setLongName("src/main/java/org/sonar/api/Plugin.java")
       .setPath("src/main/java/org/sonar/api/Plugin.java")
       .setParentProjectId(5L);
-    when(componentDao.getNullableByUuid(session, COMPONENT_UUID)).thenReturn(file);
-    when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectNullableByUuid(session, COMPONENT_UUID)).thenReturn(file);
+    when(componentDao.selectById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
     when(propertiesDao.selectByQuery(any(PropertyQuery.class), eq(session))).thenReturn(newArrayList(new PropertyDto()));
 
     WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("uuid", COMPONENT_UUID);
@@ -195,7 +195,7 @@ public class ComponentAppActionTest {
   @Test
   public void fail_on_unknown_component() {
     userSessionRule.login("john").addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
-    when(componentDao.getNullableByUuid(session, COMPONENT_UUID)).thenReturn(null);
+    when(componentDao.selectNullableByUuid(session, COMPONENT_UUID)).thenReturn(null);
 
     try {
       tester.newGetRequest("api/components", "app").setParam("uuid", COMPONENT_UUID).execute();
@@ -225,9 +225,9 @@ public class ComponentAppActionTest {
       .setLongName("src/main/java/org/sonar/api/Plugin.java")
       .setPath("src/main/java/org/sonar/api/Plugin.java")
       .setParentProjectId(5L);
-    when(componentDao.getNullableByUuid(session, COMPONENT_UUID)).thenReturn(file);
-    when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectNullableByUuid(session, COMPONENT_UUID)).thenReturn(file);
+    when(componentDao.selectById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
     return file;
   }
 
index 95319b8da4cdddd2d23cc0f44c75e6f9ea0763bb..d05ef2052a2ac0effbcf446a64c89bdf76563e25 100644 (file)
@@ -76,9 +76,9 @@ public class DuplicationsJsonWriterTest {
 
     when(componentDao.selectNullableByKey(session, key1)).thenReturn(file1);
     when(componentDao.selectNullableByKey(session, key2)).thenReturn(file2);
-    when(componentDao.getNullableById(5L, session)).thenReturn(
+    when(componentDao.selectNullableById(5L, session)).thenReturn(
       new ComponentDto().setId(5L).setKey("org.codehaus.sonar:sonar-ws-client").setLongName("SonarQube :: Web Service Client"));
-    when(componentDao.getNullableByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectNullableByUuid(session, project.uuid())).thenReturn(project);
 
     List<DuplicationsParser.Block> blocks = newArrayList();
     blocks.add(new DuplicationsParser.Block(newArrayList(
@@ -122,8 +122,8 @@ public class DuplicationsJsonWriterTest {
 
     verify(componentDao, times(2)).selectNullableByKey(eq(session), anyString());
     // Verify call to dao is cached when searching for project / sub project
-    verify(componentDao, times(1)).getNullableByUuid(eq(session), eq(project.uuid()));
-    verify(componentDao, times(1)).getNullableById(eq(5L), eq(session));
+    verify(componentDao, times(1)).selectNullableByUuid(eq(session), eq(project.uuid()));
+    verify(componentDao, times(1)).selectNullableById(eq(5L), eq(session));
   }
 
   @Test
@@ -135,7 +135,7 @@ public class DuplicationsJsonWriterTest {
 
     when(componentDao.selectNullableByKey(session, key1)).thenReturn(file1);
     when(componentDao.selectNullableByKey(session, key2)).thenReturn(file2);
-    when(componentDao.getNullableByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectNullableByUuid(session, project.uuid())).thenReturn(project);
 
     List<DuplicationsParser.Block> blocks = newArrayList();
     blocks.add(new DuplicationsParser.Block(newArrayList(
@@ -180,7 +180,7 @@ public class DuplicationsJsonWriterTest {
     ComponentDto file1 = ComponentTesting.newFileDto(project).setId(10L).setKey(key1).setLongName("PropertyDeleteQuery");
 
     when(componentDao.selectNullableByKey(session, key1)).thenReturn(file1);
-    when(componentDao.getNullableByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectNullableByUuid(session, project.uuid())).thenReturn(project);
 
     List<DuplicationsParser.Block> blocks = newArrayList();
 
index 1f680181fca90d6804a04023eaafcd85e078923c..95e0d7ec791322495b043e1f06aeb6e9dcb88a96 100644 (file)
@@ -107,7 +107,7 @@ public class ShowActionTest {
     String componentKey = "src/Foo.java";
     userSessionRule.addComponentPermission(UserRole.CODEVIEWER, "org.codehaus.sonar:sonar", componentKey);
 
-    when(componentDao.getByUuid(session, uuid)).thenReturn(new ComponentDto().setKey(componentKey));
+    when(componentDao.selectByUuid(session, uuid)).thenReturn(new ComponentDto().setKey(componentKey));
 
     ComponentDto componentDto = new ComponentDto().setId(10L);
     when(componentDao.selectNullableByKey(session, componentKey)).thenReturn(componentDto);
index 09ba7ca9fafbeba9a63fcad8face07a04bab7e83..39e3934b4be975abbecd8c75e319944d7cc4b939 100644 (file)
@@ -365,13 +365,13 @@ public class IssueQueryServiceTest {
 
     long copyResourceId = 42L;
     ComponentDto technicalProject = new ComponentDto().setProjectUuid(devUuid).setCopyResourceId(copyResourceId);
-    when(componentDao.getByUuids(isA(DbSession.class), anyCollection())).thenReturn(Arrays.asList(technicalProject));
+    when(componentDao.selectByUuids(isA(DbSession.class), anyCollection())).thenReturn(Arrays.asList(technicalProject));
 
     when(componentService.getDistinctQualifiers(isA(DbSession.class), anyCollection())).thenReturn(Sets.newHashSet("DEV_PRJ"));
     when(authorDao.selectScmAccountsByDeveloperUuids(isA(DbSession.class), anyCollection())).thenReturn(Lists.newArrayList(login1, login2));
 
     ComponentDto actualProject = new ComponentDto().setUuid(projectUuid);
-    when(componentDao.getByIds(isA(DbSession.class), anyCollection())).thenReturn(Arrays.asList(actualProject));
+    when(componentDao.selectByIds(isA(DbSession.class), anyCollection())).thenReturn(Arrays.asList(actualProject));
 
     Map<String, Object> map = newHashMap();
     map.put("componentUuids", newArrayList(copyProjectUuid));
index eae48d534ba4259534c006fdc9a168f7833c121f..d596011d889422791bb4adf1f817790917544706 100644 (file)
@@ -93,8 +93,8 @@ public class NewIssuesNotificationTest {
       .setLongName("project-long-name");
     addIssueNTimes(newIssue1(), 5);
     addIssueNTimes(newIssue2(), 3);
-    when(dbClient.componentDao().getByUuid(any(DbSession.class), eq("file-uuid")).name()).thenReturn("file-name");
-    when(dbClient.componentDao().getByUuid(any(DbSession.class), eq("directory-uuid")).name()).thenReturn("directory-name");
+    when(dbClient.componentDao().selectByUuid(any(DbSession.class), eq("file-uuid")).name()).thenReturn("file-name");
+    when(dbClient.componentDao().selectByUuid(any(DbSession.class), eq("directory-uuid")).name()).thenReturn("directory-name");
     when(ruleIndex.getByKey(RuleKey.of("SonarQube", "rule-the-world"))).thenReturn(newRule("Rule the World", "Java"));
     when(ruleIndex.getByKey(RuleKey.of("SonarQube", "rule-the-universe"))).thenReturn(newRule("Rule the Universe", "Clojure"));
 
index b9e6343413aa832148474c034b1bdaecb05ed8c7..ab039a878d234a1c73ec40a2f747eb2b9ede7807 100644 (file)
@@ -160,7 +160,7 @@ public class IssueShowActionTest {
       .setKey("org.sonar.Sonar")
       .setLongName("SonarQube")
       .setName("SonarQube");
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
 
     ComponentDto file = ComponentTesting.newFileDto(project)
       .setId(10L)
@@ -169,7 +169,7 @@ public class IssueShowActionTest {
       .setName("SonarQube :: Issue Client")
       .setQualifier("FIL")
       .setParentProjectId(1L);
-    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);
+    when(componentDao.selectByUuid(session, file.uuid())).thenReturn(file);
 
     DefaultIssue issue = new DefaultIssue()
       .setKey(issueKey)
@@ -199,7 +199,7 @@ public class IssueShowActionTest {
       .setId(1L)
       .setKey("org.sonar.Sonar")
       .setLongName("SonarQube");
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
 
     // Module
     ComponentDto module = ComponentTesting.newModuleDto(project)
@@ -208,7 +208,7 @@ public class IssueShowActionTest {
       .setLongName("SonarQube :: Server")
       .setQualifier("BRC")
       .setParentProjectId(1L);
-    when(componentDao.getNullableById(module.getId(), session)).thenReturn(module);
+    when(componentDao.selectNullableById(module.getId(), session)).thenReturn(module);
 
     // File
     ComponentDto file = ComponentTesting.newFileDto(module)
@@ -217,7 +217,7 @@ public class IssueShowActionTest {
       .setLongName("SonarQube :: Issue Client")
       .setQualifier("FIL")
       .setParentProjectId(2L);
-    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);
+    when(componentDao.selectByUuid(session, file.uuid())).thenReturn(file);
 
     DefaultIssue issue = new DefaultIssue()
       .setKey(issueKey)
@@ -249,7 +249,7 @@ public class IssueShowActionTest {
       .setKey("org.sonar.Sonar")
       .setName("SonarQube")
       .setLongName(null);
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
 
     // Module
     ComponentDto module = ComponentTesting.newModuleDto(project)
@@ -259,7 +259,7 @@ public class IssueShowActionTest {
       .setLongName(null)
       .setQualifier("BRC")
       .setParentProjectId(1L);
-    when(componentDao.getNullableById(module.getId(), session)).thenReturn(module);
+    when(componentDao.selectNullableById(module.getId(), session)).thenReturn(module);
 
     // File
     ComponentDto file = ComponentTesting.newFileDto(module)
@@ -268,7 +268,7 @@ public class IssueShowActionTest {
       .setLongName("SonarQube :: Issue Client")
       .setQualifier("FIL")
       .setParentProjectId(2L);
-    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);
+    when(componentDao.selectByUuid(session, file.uuid())).thenReturn(file);
 
     DefaultIssue issue = new DefaultIssue()
       .setKey(issueKey)
@@ -300,7 +300,7 @@ public class IssueShowActionTest {
       .setKey("org.sonar.Sonar")
       .setLongName("SonarQube")
       .setName("SonarQube");
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
 
     ComponentDto file = ComponentTesting.newFileDto(project)
       .setId(10L)
@@ -310,7 +310,7 @@ public class IssueShowActionTest {
       .setName("SonarQube :: Issue Client")
       .setQualifier("FIL")
       .setParentProjectId(1L);
-    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);
+    when(componentDao.selectByUuid(session, file.uuid())).thenReturn(file);
 
     DefaultIssue issue = createIssue()
       .setComponentUuid(file.uuid())
@@ -500,7 +500,7 @@ public class IssueShowActionTest {
       .setKey("org.sonar.Sonar")
       .setLongName("SonarQube")
       .setName("SonarQube");
-    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);
+    when(componentDao.selectByUuid(session, project.uuid())).thenReturn(project);
 
     ComponentDto file = ComponentTesting.newFileDto(project)
       .setId(10L)
@@ -509,7 +509,7 @@ public class IssueShowActionTest {
       .setName("SonarQube :: Issue Client")
       .setQualifier("FIL")
       .setParentProjectId(1L);
-    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);
+    when(componentDao.selectByUuid(session, file.uuid())).thenReturn(file);
 
     return createIssue()
       .setComponentUuid(file.uuid())
index 121d64b2b5969c1423ff03525ac7b023386357ff..7230452f6551f42e6ebaca2cd132b6906f1b70fa 100644 (file)
@@ -106,7 +106,7 @@ public class QualityGatesTest {
 
   @Before
   public void initialize() {
-    when(componentDao.getById(anyLong(), eq(session))).thenReturn(new ComponentDto().setId(1L).setKey(PROJECT_KEY));
+    when(componentDao.selectById(anyLong(), eq(session))).thenReturn(new ComponentDto().setId(1L).setKey(PROJECT_KEY));
 
     when(myBatis.openSession(false)).thenReturn(session);
     qGates = new QualityGates(dao, conditionDao, metricFinder, propertiesDao, componentDao, myBatis, userSessionRule);
index 635b215edf2d6232fed0e64872410124e6347c57..a0156dcbf705c2af4b71c1370116aae6b14fb1e4 100644 (file)
@@ -66,7 +66,7 @@ public class TestsCoveredFilesActionTest {
       new CoveredFileDoc().setFileUuid("bar-uuid").setCoveredLines(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)),
       new CoveredFileDoc().setFileUuid("file-uuid").setCoveredLines(Arrays.asList(1, 2, 3))
       ));
-    when(dbClient.componentDao().getByUuids(any(DbSession.class), anyList())).thenReturn(
+    when(dbClient.componentDao().selectByUuids(any(DbSession.class), anyList())).thenReturn(
       Arrays.asList(
         newFileDto(newProjectDto(), "bar-uuid").setKey("org.foo.Bar.java").setLongName("src/main/java/org/foo/Bar.java"),
         newFileDto(newProjectDto(), "file-uuid").setKey("org.foo.File.java").setLongName("src/main/java/org/foo/File.java")));
index 92db07f34f6775ccb9fdf8a2427e2451a194422a..626037a043bea7aa8daab48eb904a3bc9cd2879d 100644 (file)
@@ -342,7 +342,7 @@ public class ResourcePersisterTest extends AbstractDbUnitTestCase {
     enableSnapshot(1002);
     try (SqlSession session = getMyBatis().openSession(false)) {
       // FIXME selectByKey returns duplicates for libraries because of the join on snapshots table
-      ComponentDto newLib = session.getMapper(ComponentMapper.class).findByKeys(Arrays.asList("junit:junit")).get(0);
+      ComponentDto newLib = session.getMapper(ComponentMapper.class).selectByKeys(Arrays.asList("junit:junit")).get(0);
       assertThat(newLib.uuid()).isNotNull();
       assertThat(newLib.projectUuid()).isEqualTo(newLib.uuid());
       assertThat(newLib.moduleUuid()).isNull();
index c1ecdb4d362f23daa7ac81b007a63804d6a20cf7..643c34ddc190776574454b3814bf089950b3893b 100644 (file)
@@ -49,25 +49,25 @@ public interface ComponentMapper {
   /**
    * Return direct modules from a project/module
    */
-  List<ComponentDto> findModulesByProject(@Param("projectKey") String projectKey);
+  List<ComponentDto> selectModulesByProject(@Param("projectKey") String projectKey);
 
   /**
    * Return sub project of component keys
    */
-  List<ComponentDto> findSubProjectsByComponentUuids(@Param("uuids") Collection<String> uuids);
+  List<ComponentDto> selectSubProjectsByComponentUuids(@Param("uuids") Collection<String> uuids);
 
-  List<ComponentDto> findByKeys(@Param("keys") Collection<String> keys);
+  List<ComponentDto> selectByKeys(@Param("keys") Collection<String> keys);
 
-  List<ComponentDto> findByIds(@Param("ids") Collection<Long> ids);
+  List<ComponentDto> selectByIds(@Param("ids") Collection<Long> ids);
 
-  List<ComponentDto> findByUuids(@Param("uuids") Collection<String> uuids);
+  List<ComponentDto> selectByUuids(@Param("uuids") Collection<String> uuids);
 
   List<String> selectExistingUuids(@Param("uuids") Collection<String> uuids);
 
   /**
    * Return all project (PRJ/TRK) uuids
    */
-  List<String> findProjectUuids();
+  List<String> selectProjectUuids();
 
   /**
    * Return all descendant modules (including itself) from a given component uuid and scope
index 534029637de0193755b0cfee24bfaa40b0db7f64..54e3ffd9754337034a87394ef3efea7c5f9fa60e 100644 (file)
@@ -63,7 +63,7 @@
     </where>
   </select>
 
-  <select id="findModulesByProject" parameterType="String" resultType="Component">
+  <select id="selectModulesByProject" parameterType="String" resultType="Component">
     SELECT <include refid="componentColumns"/>
     FROM projects p
     INNER JOIN snapshots s ON s.project_id=p.id AND s.islast=${_true}
@@ -75,7 +75,7 @@
     </where>
   </select>
 
-  <select id="findByKeys" parameterType="String" resultType="Component">
+  <select id="selectByKeys" parameterType="String" resultType="Component">
     select <include refid="componentColumns"/>
     from projects p
     <where>
@@ -87,7 +87,7 @@
     </where>
   </select>
 
-  <select id="findByIds" parameterType="long" resultType="Component">
+  <select id="selectByIds" parameterType="long" resultType="Component">
     select
     <include refid="componentColumns"/>
     from projects p
     </where>
   </select>
 
-  <select id="findByUuids" parameterType="String" resultType="Component">
+  <select id="selectByUuids" parameterType="String" resultType="Component">
     select <include refid="componentColumns"/>
     from projects p
     <where>
     </where>
   </select>
 
-  <select id="findSubProjectsByComponentUuids" parameterType="String" resultType="Component">
+  <select id="selectSubProjectsByComponentUuids" parameterType="String" resultType="Component">
     SELECT <include refid="componentColumns"/>
     FROM projects p
     INNER JOIN projects child ON child.root_id=p.id AND child.enabled=${_true}
     <include refid="modulesTreeQuery"/>
   </select>
 
-  <select id="findProjectUuids" resultType="String">
+  <select id="selectProjectUuids" resultType="String">
     SELECT p.uuid
     FROM projects p
     <where>