Examples of findOne()


Examples of org.rhq.enterprise.server.plugins.drift.mongodb.dao.FileDAO.findOne()

        driftServer.saveChangeSetFiles(null, createChangeSetContentZipFile(file1, file2));

        FileDAO fileDAO = new FileDAO(ds.getDB());

        for (File expectedFile : asList(file1, file2)) {
            InputStream inputStream = fileDAO.findOne(expectedFile.getName());
            assertNotNull(inputStream, "Failed to find file in database with id " + expectedFile.getName());
            File actualFile = new File(getBaseDir(), "actualContent");
            actualFile.delete();
            StreamUtil.copy(inputStream, new FileOutputStream(actualFile));
            assertEquals(sha256(actualFile), sha256(expectedFile), "The SHA-256 hash in the database does not " +
View Full Code Here

Examples of org.springframework.data.gemfire.repository.sample.PersonRepository.findOne()

  @Test
  public void testRepositoryCreated() {
    PersonRepository repo = ctx.getBean(PersonRepository.class);
    Person dave = new Person(1L, "Dave", "Mathhews");
    repo.save(dave);
    Person saved = repo.findOne(1L);
    assertEquals("Dave", saved.getFirstname());
  }

  @AfterClass
  public static void cleanUp() {
View Full Code Here

Examples of org.springframework.data.jpa.repository.JpaRepository.findOne()

            final JpaRepository repository = domainTypeBasicConfiguration.getRepository();

            final Serializable id = stringToSerializable(parameterValue, (Class<? extends Serializable>) domainTypeBasicConfiguration.getPersistentEntity().getIdProperty().getType());

            final Object entity = repository.findOne(id);

            if (attribute.isCollectionLike()) {
                final Expression<Collection> objectPath = root.get(attributeName);
                return builder.isMember(entity, objectPath);
            } else {
View Full Code Here

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

    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);
    // Check that deletion worked
    List<Person> people = mongoOps.findAll(Person.class);
    log.info("Number of people = : " + people.size());
//    mongoOps.dropCollection(Person.class);
View Full Code Here

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

    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);
    // Check that deletion worked
    List<Person> people = mongoOps.findAll(Person.class);
    log.info("Number of people = : " + people.size());
//    mongoOps.dropCollection(Person.class);
View Full Code Here

Examples of org.springframework.xd.analytics.metrics.core.CounterRepository.findOne()

    Counter yourCounter = repo.save(c2);
    assertThat(yourCounter.getName(), is(notNullValue()));
    assertTrue(repo.exists(yourCounterName));

    // Retrieve by name and compare for equality to previously saved instance.
    Counter result = repo.findOne(myCounterName);
    assertThat(result, equalTo(myCounter));

    result = repo.findOne(yourCounter.getName());
    assertThat(result, equalTo(yourCounter));
View Full Code Here

Examples of org.springframework.xd.analytics.metrics.core.GaugeRepository.findOne()

    Gauge yourGauge = repo.save(g2);
    assertThat(yourGauge.getName(), is(notNullValue()));
    assertTrue(repo.exists(yourGauge.getName()));

    // Retrieve by name and compare for equality to previously saved instance.
    Gauge result = repo.findOne(myGaugeName);
    assertThat(result, equalTo(myGauge));

    result = repo.findOne(yourGauge.getName());
    assertThat(result, equalTo(yourGauge));
View Full Code Here

Examples of org.springframework.xd.analytics.metrics.core.RichGaugeRepository.findOne()

  public void getOrCreateReturnsCorrectInstance() throws Exception {
    RichGaugeRepository gs = createService();
    gs.setValue("test", 9.99);
    gs.setValue("test", 0.01);

    RichGauge g = gs.findOne("test");
    assertEquals("test", g.getName());
    assertEquals(0.01, g.getValue(), 1E-6);
    assertEquals(5.0, g.getAverage(), 1E-6);
    assertEquals(9.99, g.getMax(), 1E-6);
    assertEquals(0.01, g.getMin(), 1E-6);
View Full Code Here

Examples of org.tarantool.core.impl.SocketChannelTarantoolConnection.findOne()

      }
    }
    writer.close();
    reader.close();
    SocketChannelTarantoolConnection con = new SocketChannelTarantoolConnection();
    Tuple t = con.findOne(0, 0, 0, new Tuple(1).setInt(0, 1));
    System.out.println(t.getLong(4));
    con.close();
  }

}
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.