projectSequenceList.add(new ProjectSequence(new ProjectSequence.ProjectSequenceId(project.getId(), reference)));
@Override public String toString() { return new ToStringBuilder(this) .append("id", getId()) .append("key", getKey()) .append("qualifier", getQualifier()) .toString(); }
@Repository public class StatsRepositoryImpl implements StatsRepository { @SuppressWarnings("unused") @PostConstruct private void initStatements(){ if (cassandraSession == null){ LOG.error("Cassandra 2.0 not available"); } else { GETSTATS_BY_PROJECT = cassandraSession.prepare(SELECTSTATS+" WHERE projectid = ?"); } } @Override public Stats findByProject(Project project) { Stats stats = null; BoundStatement boundStatement = new BoundStatement(GETSTATS_BY_PROJECT); ResultSet rs = cassandraSession.execute(boundStatement.bind(project.getId())); for (Row row : rs){ stats = mapRowToStats(row); } return stats; }
@Transactional public void updateProject(Project project) { Project itemFromDbs = this.getById(project.getId()); if (itemFromDbs != null) { itemFromDbs.setTaskPlans(project.getTaskPlans()); entityManager.merge(itemFromDbs);//so i wont persist a detached entity entityManager.flush(); } }
@Override public void analyse(Project project, SensorContext context) { // Adding one second is a hack for resolving conflicts with concurrent user // changes during issue persistence final Date now = DateUtils.addSeconds(DateUtils.truncate(new Date(), Calendar.MILLISECOND), 1); issueDao.selectNonClosedIssuesByModule(project.getId(), new ResultHandler() { @Override public void handleResult(ResultContext rc) { IssueDto dto = (IssueDto) rc.getResultObject(); dto.setSelectedAt(now.getTime()); initialOpenIssuesStack.addIssue(dto); } }); issueChangeDao.selectChangelogOnNonClosedIssuesByModuleAndType(project.getId(), new ResultHandler() { @Override public void handleResult(ResultContext rc) { IssueChangeDto dto = (IssueChangeDto) rc.getResultObject(); initialOpenIssuesStack.addChangelog(dto); } }); }
public DbDuplicationsIndex(Project currentProject, DuplicationDao dao, String language, DatabaseSession session, ResourceCache resourceCache) { this.dao = dao; this.session = session; this.resourceCache = resourceCache; Snapshot lastSnapshot = getLastSnapshot(currentProject.getId()); this.currentProjectSnapshotId = resourceCache.get(currentProject.getEffectiveKey()).snapshotId(); this.lastSnapshotId = lastSnapshot == null ? null : lastSnapshot.getId(); this.languageKey = language; }