Package org.springframework.data.elasticsearch.core.query

Examples of org.springframework.data.elasticsearch.core.query.CriteriaQuery


  @Override
  protected CriteriaQuery create(Part part, Iterator<Object> iterator) {
    PersistentPropertyPath<ElasticsearchPersistentProperty> path = context
        .getPersistentPropertyPath(part.getProperty());
    return new CriteriaQuery(from(part.getType(),
        new Criteria(path.toDotPath(ElasticsearchPersistentProperty.PropertyToFieldNameConverter.INSTANCE)), iterator));
  }
View Full Code Here


        new Criteria(path.toDotPath(ElasticsearchPersistentProperty.PropertyToFieldNameConverter.INSTANCE)), iterator));
  }

  @Override
  protected CriteriaQuery or(CriteriaQuery base, CriteriaQuery query) {
    return new CriteriaQuery(base.getCriteria().or(query.getCriteria()));
  }
View Full Code Here

    }

    @Override
    public Object execute(Object[] parameters) {
        ParametersParameterAccessor accessor = new ParametersParameterAccessor(queryMethod.getParameters(), parameters);
        CriteriaQuery query = createQuery(accessor);
        if(queryMethod.isPageQuery()){
            query.setPageable(accessor.getPageable());
            return elasticsearchOperations.queryForPage(query, queryMethod.getEntityInformation().getJavaType());
        } else if (queryMethod.isCollectionQuery()) {
            if(accessor.getPageable() != null){
                query.setPageable(accessor.getPageable());
            }
            return elasticsearchOperations.queryForList(query,queryMethod.getEntityInformation().getJavaType());
        }
        return elasticsearchOperations.queryForObject(query, queryMethod.getEntityInformation().getJavaType());
    }
View Full Code Here

    }

    @Override
    protected CriteriaQuery create(Part part, Iterator<Object> iterator) {
        PersistentPropertyPath<ElasticsearchPersistentProperty> path = context.getPersistentPropertyPath(part.getProperty());
        return new CriteriaQuery(from(part.getType(),
                new Criteria(path.toDotPath(ElasticsearchPersistentProperty.PropertyToFieldNameConverter.INSTANCE)), iterator));
    }
View Full Code Here

                new Criteria(path.toDotPath(ElasticsearchPersistentProperty.PropertyToFieldNameConverter.INSTANCE)), iterator));
    }

    @Override
    protected CriteriaQuery or(CriteriaQuery base, CriteriaQuery query) {
        return new CriteriaQuery(base.getCriteria().or(query.getCriteria()));
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.elasticsearch.core.query.CriteriaQuery

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.