From e72b7db9c0983eace302e0bb0fe2c83ade0d1106 Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Wed, 20 Aug 2014 17:05:23 +0200 Subject: fixed synchronization --- .../org/sonar/server/activity/db/ActivityDao.java | 7 +------ .../sonar/server/qualityprofile/db/ActiveRuleDao.java | 19 ++----------------- 2 files changed, 3 insertions(+), 23 deletions(-) (limited to 'server') 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 { @Override protected Iterable findAfterDate(DbSession session, Date date) { - // for (ActivityDto activity : this.findAll(session)) { -// session.enqueue(new DtoIndexAction(this.getIndexType(), IndexAction.Method.UPSERT, activity)); -// } -// session.commit(); - return Collections.EMPTY_LIST; + return mapper(session).selectAll(); } public List 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 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 fields = (Map) 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(getIndexType(), IndexAction.Method.UPSERT, key)); -// } -// }); -// session.commit(); -// } - return Collections.EMPTY_LIST; + return mapper(session).selectAfterDate(new Timestamp(date.getTime())); } /** -- cgit v1.2.3