Package org.springframework.data.neo4j.aspects

Examples of org.springframework.data.neo4j.aspects.Group


    @Test
    @Transactional
    public void testTraverseFromGroupToPeopleWithFinder() {
        final GraphRepository<Person> finder = neo4jTemplate.repositoryFor(Person.class);
        Person p = persistedPerson("Michael", 35);
        Group group = persist(new Group());
        group.setName("dev");
        group.addPerson(p);
        final TraversalDescription traversalDescription = Traversal.description().relationships(DynamicRelationshipType.withName("persons")).evaluator(Evaluators.excludeStartPosition());
        Iterable<Person> people = finder.findAllByTraversal(group, traversalDescription);
        final HashSet<Person> found = new HashSet<Person>();
        for (Person person : people) {
            found.add(person);
View Full Code Here


    @Test
    @Transactional
    public void testFindByNamedQuery() {
        final TestTeam testTeam = new TestTeam(neo4jTemplate);
        testTeam.createSDGTeam();
        Group team = personRepository.findTeam(testTeam.michael);
        assertThat(team, is(testTeam.sdg));
    }
View Full Code Here

    @Test
  @Transactional
  public void testFindAllOnGroup() {
      log.debug("FindAllOnGroup start");
        Group g = persist(new Group());
        g.setName("test");
        Group g2 = persist(new Group());
        g.setName("test");
        Collection<Group> groups = IteratorUtil.addToCollection(groupRepository.findAll().iterator(), new HashSet<Group>());
        assertEquals(2, groups.size());
  }
View Full Code Here

    @Test
    //@Transactional
    //@Ignore("remove property from index not workin")
    public void testRemovePropertyFromIndex() {
        try (Transaction tx = neo4jTemplate.getGraphDatabase().beginTx()) {
            Group group = persist(new Group());
            group.setName(NAME_VALUE);
            getGroupIndex().remove(getNodeState(group), NAME);
            tx.success();
        }
        final Group found = this.groupRepository.findByPropertyValue(NAME, NAME_VALUE);
        assertNull("Group.name removed from index", found);
    }
View Full Code Here

    @Test
    //@Transactional
    //@Ignore("remove property from index not workin")
    public void testRemoveNodeFromIndex() {
        try (Transaction tx = neo4jTemplate.getGraphDatabase().beginTx()) {
            Group group = persist(new Group());
            group.setName(NAME_VALUE);
            getGroupIndex().remove(getNodeState(group));
            tx.success();
        }
        final Group found = this.groupRepository.findByPropertyValue(NAME, NAME_VALUE);
        assertNull("Group.name removed from index", found);
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testFindGroupByIndex() {
        Group group = persist(new Group());
        group.setName(NAME_VALUE);
        final Group found = this.groupRepository.findByPropertyValue(NAME, NAME_VALUE);
        assertEquals(group, found);
    }
View Full Code Here

    @Test
    @Transactional
    @Ignore
    public void testFindGroupByInstanceIndex() {
        Group group = persist(new SubGroup());
        group.setIndexLevelName("indexLevelNameValue");
        Index<Node> subGroupIndex = neo4jTemplate.getIndex(SubGroup.class);
        final Node found = subGroupIndex.get("indexLevelName", "indexLevelNameValue").getSingle();
        final SubGroup foundEntity = neo4jTemplate.createEntityFromState(found, SubGroup.class, neo4jTemplate.getMappingPolicy(SubGroup.class));
        assertEquals(group, foundEntity);
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testFindGroupByAlternativeFieldNameIndex() {
        Group group = persist(new Group());
        group.setOtherName(NAME_VALUE);
        final Group found = this.groupRepository.findByPropertyValue(Group.OTHER_NAME_INDEX, NAME_VALUE);
        assertEquals(group, found);
    }
View Full Code Here

    @Test
    @Transactional
    @Ignore
    public void testDontFindGroupByNonIndexedFieldWithAnnotation() {
        Group group = persist(new Group());
        group.setUnindexedName("value-unindexedName");
        final Group found = this.groupRepository.findByPropertyValue("unindexedName", "value-unindexedName");
        assertNull(found);
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testDontFindGroupByNonIndexedField() {
        Group group = persist(new Group());
        group.setUnindexedName2("value-unindexedName2");
        final Group found = this.groupRepository.findByPropertyValue("unindexedName2", "value-unindexedName2");
        assertNull(found);
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.aspects.Group

Copyright © 2018 www.massapicom. 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.