Examples of GraphDatabase


Examples of org.springframework.data.neo4j.core.GraphDatabase

  }

  @Test
  public void testRepositoryStyle1IsCreatedCorrectly() {

    GraphDatabase database = container.getInstance(GraphDatabase.class);
    RepositoryClient client = container.getInstance(RepositoryClient.class);
    CdiPersonRepository repository = client.repository;

    assertThat(repository, is(notNullValue()));

    Person person = null;
    Person result = null;

    try (Transaction tx = database.beginTx()) {
      repository.deleteAll();

      person = new Person("Simon", 28);
      result = repository.save(person);
      tx.success();
    }

        try (Transaction tx = database.beginTx()) {
            assertThat(result, is(notNullValue()));
            Long resultId = result.getId();
            Person lookedUpPerson = repository.findOne(person.getId());
            assertThat(lookedUpPerson.getId(), is(resultId));
            tx.success();
View Full Code Here

Examples of org.springframework.data.neo4j.core.GraphDatabase

  }

  @Test
  public void testRepositoryStyle2IsCreatedCorrectly() {

    GraphDatabase database = container.getInstance(GraphDatabase.class);
    RepositoryClient client = container.getInstance(RepositoryClient.class);
    CdiPersonRepository2 repository = client.repository2;

    assertThat(repository, is(notNullValue()));

    Person person = null;
    Person result = null;

    try (Transaction tx = database.beginTx()) {
      repository.deleteAll();

      person = new Person("Simon", 28);
      result = repository.save(person);
      tx.success();
    }

        try (Transaction tx = database.beginTx()) {
            assertThat(result, is(notNullValue()));
            Long resultId = result.getId();
            Person lookedUpPerson = repository.findOne(person.getId());
            assertThat(lookedUpPerson.getId(), is(resultId));
            tx.success();
View Full Code Here

Examples of org.springframework.data.neo4j.core.GraphDatabase

  }

  @Test
  public void neo4jCrudRepositorySubTypeWorks() {

    GraphDatabase database = container.getInstance(GraphDatabase.class);
    RepositoryClient client = container.getInstance(RepositoryClient.class);
    CdiPersonRepository3 repository = client.repository3;

    assertThat(repository, is(notNullValue()));

    Person person = null;
    Person result = null;

    try (Transaction tx = database.beginTx()) {
      repository.deleteAll();

      person = new Person("Simon", 28);
      result = repository.save(person);
      tx.success();
    }

        try (Transaction tx = database.beginTx()) {
            assertThat(result, is(notNullValue()));
            Long resultId = result.getId();
            Person lookedUpPerson = repository.findOne(person.getId());
            assertThat(lookedUpPerson.getId(), is(resultId));
            tx.success();
View Full Code Here

Examples of org.springframework.data.neo4j.core.GraphDatabase

   * @see DATAGRAPH-500
   */
  @Test
  public void returnOneFromCustomImpl() {

    GraphDatabase database = container.getInstance(GraphDatabase.class);

    try (Transaction tx = database.beginTx()) {

      RepositoryClient client = container.getInstance(RepositoryClient.class);
      assertThat(client.samplePersonRepository.returnOne(), is(1));
    }
  }
View Full Code Here

Examples of org.springframework.data.neo4j.core.GraphDatabase

    private Person michael;
    private EntityResultConverter entityResultConverter;

    @Before
    public void setUp() throws Exception {
        GraphDatabase graphDatabase = createGraphDatabase();
        graphDatabase.setConversionService(conversionService);
        entityResultConverter = new EntityResultConverter(conversionService).with( template );
        testTeam.createSDGTeam();
        queryEngine = graphDatabase.queryEngine();
        michael = testTeam.michael;
    }
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.