diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-08-20 17:05:23 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-08-20 18:18:39 +0200 |
commit | e72b7db9c0983eace302e0bb0fe2c83ade0d1106 (patch) | |
tree | 640b5c31fcee0d0cdd2924d22e3924ffc97de263 /server | |
parent | c7bdd0a2e79ca01249bd9e8dfbb6aa2839b57af1 (diff) | |
download | sonarqube-e72b7db9c0983eace302e0bb0fe2c83ade0d1106.tar.gz sonarqube-e72b7db9c0983eace302e0bb0fe2c83ade0d1106.zip |
fixed synchronization
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/activity/db/ActivityDao.java | 7 | ||||
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/qualityprofile/db/ActiveRuleDao.java | 19 |
2 files changed, 3 insertions, 23 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/activity/db/ActivityDao.java b/server/sonar-server/src/main/java/org/sonar/server/activity/db/ActivityDao.java index df395320c09..27fff1d30f6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/activity/db/ActivityDao.java +++ b/server/sonar-server/src/main/java/org/sonar/server/activity/db/ActivityDao.java @@ -26,7 +26,6 @@ import org.sonar.core.persistence.DbSession; import org.sonar.server.db.BaseDao; import org.sonar.server.search.IndexDefinition; -import java.util.Collections; import java.util.Date; import java.util.List; @@ -62,11 +61,7 @@ public class ActivityDao extends BaseDao<ActivityMapper, ActivityDto, String> { @Override protected Iterable<ActivityDto> findAfterDate(DbSession session, Date date) { - // for (ActivityDto activity : this.findAll(session)) { -// session.enqueue(new DtoIndexAction<ActivityDto>(this.getIndexType(), IndexAction.Method.UPSERT, activity)); -// } -// session.commit(); - return Collections.EMPTY_LIST; + return mapper(session).selectAll(); } public List<ActivityDto> findAll(DbSession session) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/db/ActiveRuleDao.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/db/ActiveRuleDao.java index 682ed69f762..1cd5966e5fb 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/db/ActiveRuleDao.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/db/ActiveRuleDao.java @@ -36,7 +36,7 @@ import org.sonar.server.rule.db.RuleDao; import org.sonar.server.search.IndexDefinition; import javax.annotation.CheckForNull; -import java.util.Collections; +import java.sql.Timestamp; import java.util.Date; import java.util.List; @@ -119,22 +119,7 @@ public class ActiveRuleDao extends BaseDao<ActiveRuleMapper, ActiveRuleDto, Acti @Override protected Iterable<ActiveRuleDto> findAfterDate(DbSession session, Date date) { -// @Override -// public void synchronizeAfter(final DbSession session, Date date) { -// session.select("selectAllKeysAfterTimestamp", new Timestamp(date.getTime()), new ResultHandler() { -// @Override -// public void handleResult(ResultContext context) { -// Map<String, Object> fields = (Map<String, Object>) context.getResultObject(); -// // "rule" is a reserved keyword in SQLServer, so "rulefield" is used -// ActiveRuleKey key = ActiveRuleKey.of( -// (String) fields.get("profileKey"), -// RuleKey.of((String) fields.get("repository"), (String) fields.get("rulefield"))); -// session.enqueue(new KeyIndexAction<ActiveRuleKey>(getIndexType(), IndexAction.Method.UPSERT, key)); -// } -// }); -// session.commit(); -// } - return Collections.EMPTY_LIST; + return mapper(session).selectAfterDate(new Timestamp(date.getTime())); } /** |