Examples of findById()


Examples of org.sonar.core.rule.CacheRuleFinder.findById()

  @Test
  public void shouldCacheFindById() {
    setupData("shared");
    RuleFinder finder = new CacheRuleFinder(getSessionFactory());
    assertThat(finder.findById(3).getConfigKey(), is("Checker/Treewalker/AnnotationUseStyleCheck"));

    deleteRules();

    assertThat(finder.findById(3), notNullValue());
  }
View Full Code Here

Examples of org.springframework.data.mongodb.core.MongoOperations.findById()

        new Mongo(), "database"));
    Person p = new Person("Joe", 34);
    // Insert is used to initially store the object into the database.
    mongoOps.insert(p);
    log.info("Insert: " + p); // Find
    p = mongoOps.findById(p.getId(), Person.class);
    log.info("Found: " + p); // Update
    mongoOps.updateFirst(query(where("name").is("Joe")), update("age", 35),
        Person.class);
    p = mongoOps.findOne(query(where("name").is("Joe")), Person.class);
    log.info("Updated: " + p); // Delete mongoOps.remove(p);
View Full Code Here

Examples of org.springframework.data.mongodb.core.MongoTemplate.findById()

        new Mongo(), "database"));
    Person p = new Person("Joe", 34);
    // Insert is used to initially store the object into the database.
    mongoOps.insert(p);
    log.info("Insert: " + p); // Find
    p = mongoOps.findById(p.getId(), Person.class);
    log.info("Found: " + p); // Update
    mongoOps.updateFirst(query(where("name").is("Joe")), update("age", 35),
        Person.class);
    p = mongoOps.findOne(query(where("name").is("Joe")), Person.class);
    log.info("Updated: " + p); // Delete mongoOps.remove(p);
View Full Code Here

Examples of org.timedex.dao.impl.PageDAOImpl.findById()

     
      for (PageLink pl : chunk) {
        try {
          sessionStrategy.beginTransaction();
         
          Page found = pageDAO.findById(pl.getSourcePageId());
         
          if (found == null) {
            pageLinkDAO.delete(pl);
            erased++;
          } else {
View Full Code Here

Examples of org.timedex.dao.interfaces.EventDAO.findById()

    Iterator it = hits.iterator();
    try {
      while(it.hasNext() && events.size() < maxResults) {
        Document d = ((Hit)it.next()).getDocument();
        long eventId = Long.parseLong(d.getField("event_id").stringValue());
        Event found = eventDAO.findById(eventId);
        events.add(found);
      }
      return events;
    }catch(IOException e) {
      System.out.println("index being used: " + LUCENE_INDEX);
View Full Code Here

Examples of org.timedex.dao.interfaces.PageDAO.findById()

     
      for (PageLink pl : chunk) {
        try {
          sessionStrategy.beginTransaction();
         
          Page found = pageDAO.findById(pl.getSourcePageId());
         
          if (found == null) {
            pageLinkDAO.delete(pl);
            erased++;
          } else {
View Full Code Here

Examples of org.zanata.dao.PersonDAO.findById()

    @Test
    public void getAllActiveAndMaintainedGroupsTest() {
        // personId = 1 is maintainers for group1 and group3(obsolote)
        PersonDAO personDAO = new PersonDAO(getSession());
        HPerson person = personDAO.findById(new Long(1));
        List<HIterationGroup> result =
                versionGroupServiceImpl.getAllActiveAndMaintainedGroups(person);

        assertThat(result.size(), equalTo(3));
    }
View Full Code Here

Examples of org.zanata.dao.ProjectIterationDAO.findById()

        assertThat(map.size(), equalTo(activateLocaleSize));

        // See ProjectsData.dbunit.xml, HProjectIteration id="900" in group1
        ProjectIterationDAO projectIterationDAO =
                new ProjectIterationDAO(getSession());
        HProjectIteration version = projectIterationDAO.findById(new Long(900));

        for (List<HProjectIteration> versions : map.values()) {
            assertThat("", versions, Matchers.contains(version));
        }
    }
View Full Code Here

Examples of org.zanata.dao.TextFlowDAO.findById()

                new VersionLocaleKey(event.getProjectIterationId(),
                        event.getLocaleId());
        WordStatistic stats = versionStatisticCache.get(key);
        if (stats != null) {
            TextFlowDAO textFlowDAO = serviceLocator.getInstance(TextFlowDAO.class);
            HTextFlow textFlow = textFlowDAO.findById(event.getTextFlowId());

            stats.decrement(event.getPreviousState(),
                    textFlow.getWordCount().intValue());
            stats.increment(event.getNewState(),
                    textFlow.getWordCount().intValue());
View Full Code Here

Examples of oss.ngocminh.lego.persistence.ProductDAO.findById()

      throws ServletException, IOException {
    try {
      Connection conn = getConnection();
      ProductDAO productDAO = new ProductDAO(conn);
      int productId = Integer.parseInt(req.getParameter("product"));
      Entity product = productDAO.findById(productId);
      productDAO.fetchImage(product);
      int quantity = Integer.parseInt(req.getParameter("quantity"));
      conn.close();
     
      List<Entity> orders = (List<Entity>) req.getSession().getAttribute("orders");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.