aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-11-12 09:53:35 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-11-12 11:01:30 +0100
commit86b52cb91e64c09db494cc3d62fbd00729ded2e5 (patch)
tree4d82d923f92ad4b016cf27aa1dc70c758ffbdab2 /sonar-db
parent29f0f0de0103bbae318cfb2cc324b2ff360c2cf4 (diff)
downloadsonarqube-86b52cb91e64c09db494cc3d62fbd00729ded2e5.tar.gz
sonarqube-86b52cb91e64c09db494cc3d62fbd00729ded2e5.zip
SONAR-6993 Persist cpd text blocks into DUPLICATIONS_INDEX
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/duplication/DuplicationDao.java7
-rw-r--r--sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java4
2 files changed, 4 insertions, 7 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/duplication/DuplicationDao.java b/sonar-db/src/main/java/org/sonar/db/duplication/DuplicationDao.java
index a53017ea7b1..0e187ea0f76 100644
--- a/sonar-db/src/main/java/org/sonar/db/duplication/DuplicationDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/duplication/DuplicationDao.java
@@ -46,11 +46,8 @@ public class DuplicationDao implements Dao {
* Insert rows in the table DUPLICATIONS_INDEX.
* Note that generated ids are not returned.
*/
- public void insert(DbSession session, Collection<DuplicationUnitDto> units) {
- DuplicationMapper mapper = session.getMapper(DuplicationMapper.class);
- for (DuplicationUnitDto unit : units) {
- mapper.batchInsert(unit);
- }
+ public void insert(DbSession session, DuplicationUnitDto dto) {
+ session.getMapper(DuplicationMapper.class).batchInsert(dto);
}
}
diff --git a/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java b/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java
index 7936524d898..4427b8c69c3 100644
--- a/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java
@@ -66,13 +66,13 @@ public class DuplicationDaoTest {
db.prepareDbUnit(getClass(), "insert.xml");
dbSession.commit();
- dao.insert(dbSession, singletonList(new DuplicationUnitDto()
+ dao.insert(dbSession, new DuplicationUnitDto()
.setProjectSnapshotId(1)
.setSnapshotId(2)
.setHash("bb")
.setIndexInFile(0)
.setStartLine(1)
- .setEndLine(2)));
+ .setEndLine(2));
dbSession.commit();
db.assertDbUnit(getClass(), "insert-result.xml", "duplications_index");