Package org.springframework.data.neo4j.annotation

Examples of org.springframework.data.neo4j.annotation.RelationshipEntity.type()


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

    @Override
    public String toString() {
        return String.format("%s %smanaged @%sEntity Annotations: %s", getType(), isManaged() ? "" : "un", isNodeEntity() ? "Node" : "Relationship", annotations.keySet());
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();
    }

    @Override
    public String toString() {
        return String.format("%s %smanaged @%sEntity Annotations: %s", getType(), isManaged() ? "" : "un", isNodeEntity() ? "Node" : "Relationship", annotations.keySet());
View Full Code Here

        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

        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

            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();
    }

    private static TypeInformation<?> elementClass(RelatedToVia annotation, TypeInformation<?> typeInformation) {
        return annotation.elementClass() != Object.class ? ClassTypeInformation.from(annotation.elementClass()) : typeInformation.getActualType();
    }
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.