Examples of Neo4jMappingContext


Examples of org.springframework.data.neo4j.support.mapping.Neo4jMappingContext

     */
    protected void removeMissingRelationshipsInStoreAndKeepOnlyNewRelationShipsInSet( Node node,
                                                                                      Set<Node> targetNodes,
                                                                                      Class<?> targetType ) {
        Neo4jMappingContext mappingContext = template.getInfrastructure().getMappingContext();
        for ( Relationship relationship : node.getRelationships( type, direction ) ) {
            Node otherNode = relationship.getOtherNode(node);
            if ( !targetNodes.remove(otherNode) ) {
                if ( targetType != null ) {
                    Object actualTargetType = determineEndNodeType(otherNode);
                    try {
                        Neo4jPersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(actualTargetType);
                        if (! targetType.isAssignableFrom(persistentEntity.getType())) continue;
                    } catch (Exception e) {
                        throw new IllegalStateException(format("Could not read type '%s' - type does not exist", actualTargetType), e);
                    }
                }
View Full Code Here

Examples of org.springframework.data.neo4j.support.mapping.Neo4jMappingContext

        @RelatedTo TestRelationship test;
    }

    @Test(expected = MappingException.class)
    public void testFailInvalidRelatedTo() throws Exception {
        MappingContext context = new Neo4jMappingContext();
        context.getPersistentEntity(TestEntityRelatedTo.class);
    }
View Full Code Here

Examples of org.springframework.data.neo4j.support.mapping.Neo4jMappingContext

        MappingContext context = new Neo4jMappingContext();
        context.getPersistentEntity(TestEntityRelatedTo.class);
    }
    @Test(expected = MappingException.class)
    public void testFailInvalidRelatedToVia() throws Exception {
        MappingContext context = new Neo4jMappingContext();
        context.getPersistentEntity(TestEntityRelatedToVia.class);
    }
View Full Code Here

Examples of org.springframework.data.neo4j.support.mapping.Neo4jMappingContext

    VariableContext context;

    @Before
    public void setUp() {

        mappingContext = new Neo4jMappingContext();
        context = new VariableContext();
    }
View Full Code Here

Examples of org.springframework.data.neo4j.support.mapping.Neo4jMappingContext

    private Neo4jMappingContext mappingContext;
    private Neo4jPersistentEntityImpl<?> personType;

    @Before
    public void setUp() throws Exception {
        mappingContext = new Neo4jMappingContext();
        mappingContext.setInitialEntitySet(Collections.singleton(Person.class));
        personType = mappingContext.getPersistentEntity(Person.class);
    }
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.