Package org.springframework.data.neo4j.support.mapping

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


        if (!annotation.indexName().isEmpty()) throw new MappingException("No index name allowed on label based indexes, property: "+ property.getOwner().getName()+"."+property.getName());
        Neo4jPersistentEntity<?> entity = property.getOwner();

        // NW StoredEntityType not available at this stage yet ....
        // only set when entity.updateStoredType(..) called
        StoredEntityType entityType = entity.getEntityType();
        switch (annotation.level()) {
            case CLASS:
                Class<?> declaringClass = property.getField().getDeclaringClass();
                return
                    (entityType != null)
                            ? entityType.findByTypeClass(declaringClass).getAlias().toString()
                            : doBestGuessLabelName(entity)// Not right but not sure what to do here
            case INSTANCE:
                return
                    (entityType != null)
                            ? entityType.getAlias().toString()
                            : doBestGuessLabelName(entity)// Not right but not sure what to do here
            case GLOBAL: throw new MappingException("No global index for label based indexes");
        }
        return entityType.getAlias().toString();
    }
View Full Code Here


        personType = mappingContext.getPersistentEntity(Person.class);
    }

    @Test
    public void testDirectEntityType() {
        final StoredEntityType entityType = personType.getEntityType();
        assertEquals("Person",entityType.getAlias());
        assertEquals(Person.class, entityType.getType());
        assertEquals(1,entityType.getSuperTypes().size());
        final StoredEntityType superType = IteratorUtil.single(entityType.getSuperTypes());
        assertEquals(Being.class, superType.getType());
        assertEquals("Being", superType.getAlias());
        assertEquals(0,superType.getSuperTypes().size());
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.support.mapping.StoredEntityType

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.