Package org.springframework.data.neo4j.annotation

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


import static org.springframework.data.neo4j.support.DoReturn.doReturn;

public class QueryFieldAccessorFactory implements FieldAccessorFactory<NodeBacked> {
  @Override
    public boolean accept(final Neo4JPersistentProperty f) {
        final Query query = f.getAnnotation(Query.class);
        return query != null
                && !query.value().isEmpty();
    }
View Full Code Here


        protected String[] annotationParams;
        private boolean iterableResult;

        public QueryFieldAccessor(final Neo4JPersistentProperty property) {
          this.property = property;
            final Query query = property.getAnnotation(Query.class);
            this.annotationParams = query.params();
            if ((this.annotationParams.length % 2) != 0) {
                throw new IllegalArgumentException("Number of parameters has to be even to construct a parameter map");
            }
            this.query = query.value();
            this.iterableResult = Iterable.class.isAssignableFrom(property.getType());
            this.target = resolveTarget(query,property);
        }
View Full Code Here

        this.myAssociation = isAssociation() ? super.getAssociation() == null ? createAssociation() : super.getAssociation() : null;
        this.query = extractQuery();
    }

    private String extractQuery() {
        final Query query = getAnnotation(Query.class);
        if (query == null) return null;
        String value = query.value();
        return value.trim().isEmpty() ? null : value;
    }
View Full Code Here

        private final CypherQueryEngine queryEngine;

        public QueryFieldAccessor(final Neo4jPersistentProperty property, Neo4jTemplate template) {
          this.property = property;
            this.template = template;
            final Query query = property.findAnnotation(Query.class);
            this.annotationParams = query.params();
            if ((this.annotationParams.length % 2) != 0) {
                throw new IllegalArgumentException("Number of parameters has to be even to construct a parameter map");
            }
            this.query = property.getQuery();
            this.iterableResult = Iterable.class.isAssignableFrom(property.getType());
View Full Code Here

TOP

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

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.