diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-04-09 11:53:32 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-04-09 11:53:32 +0200 |
commit | 9a934db810c4b91b13ff6fafa2bb50dcdd933d63 (patch) | |
tree | 6fe865ed37c77cb6e64ca3b6abbbb83ec8a3566d /sonar-core | |
parent | 0dc04c7e5a4f0e02d18cd2fef91924ddd6d30cc6 (diff) | |
download | sonarqube-9a934db810c4b91b13ff6fafa2bb50dcdd933d63.tar.gz sonarqube-9a934db810c4b91b13ff6fafa2bb50dcdd933d63.zip |
SONAR-6258 Persist source, coverage and scm into file sources
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDao.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDao.java b/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDao.java index 16864674f20..cbd920455e9 100644 --- a/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDao.java +++ b/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDao.java @@ -104,23 +104,31 @@ public class FileSourceDao implements BatchComponent, ServerComponent, DaoCompon public void insert(FileSourceDto dto) { DbSession session = mybatis.openSession(false); try { - session.getMapper(FileSourceMapper.class).insert(dto); + insert(session, dto); session.commit(); } finally { MyBatis.closeQuietly(session); } } + public void insert(DbSession session, FileSourceDto dto) { + session.getMapper(FileSourceMapper.class).insert(dto); + } + public void update(FileSourceDto dto) { DbSession session = mybatis.openSession(false); try { - session.getMapper(FileSourceMapper.class).update(dto); + update(session, dto); session.commit(); } finally { MyBatis.closeQuietly(session); } } + public void update(DbSession session, FileSourceDto dto) { + session.getMapper(FileSourceMapper.class).update(dto); + } + public void updateDateWhenUpdatedDateIsZero(DbSession session, String projectUuid, long updateDate) { session.getMapper(FileSourceMapper.class).updateDateWhenUpdatedDateIsZero(projectUuid, updateDate); } |