Package org.springframework.data.neo4j.annotation

Examples of org.springframework.data.neo4j.annotation.RelationshipEntity


    }

    public boolean useShortNames() {
        final NodeEntity graphEntity = getAnnotation(NodeEntity.class);
        if (graphEntity != null) return graphEntity.useShortNames();
        final RelationshipEntity graphRelationship = getAnnotation(RelationshipEntity.class);
        if (graphRelationship != null) return graphRelationship.useShortNames();
        return false;
    }
View Full Code Here


    }

    private boolean shouldUseShortNames() {
        final NodeEntity graphEntity = getAnnotation(NodeEntity.class);
        if (graphEntity != null) return graphEntity.useShortNames();
        final RelationshipEntity graphRelationship = getAnnotation(RelationshipEntity.class);
        if (graphRelationship != null) return graphRelationship.useShortNames();
        return false;
    }
View Full Code Here

    }

    @Override
    public String getRelationshipType() {
        if (!isRelationshipEntity()) return null;
        final RelationshipEntity annotation = getAnnotation(RelationshipEntity.class);
        return annotation.type().isEmpty() ? null : annotation.type();
    }
View Full Code Here

    }

    private static String relationshipType(RelatedToVia annotation, TypeInformation<?> typeInformation) {
        if (!annotation.type().isEmpty()) return annotation.type();
        final TypeInformation<?> relationshipEntityType = elementClass(annotation, typeInformation);
        final RelationshipEntity relationshipEntity = relationshipEntityType.getType().getAnnotation(RelationshipEntity.class);
        if (relationshipEntity==null) {
            throw new MappingException(typeInformation.getType()+" is no RelationshipEntity");
        }
        if (relationshipEntity.type()==null || relationshipEntity.type().isEmpty()) {
            throw new MappingException("Relationship entity must have a default type");
        }
        return relationshipEntity.type();
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.annotation.RelationshipEntity

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.