org.springframework.data.neo4j.annotation.Query类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.springframework.data.neo4j.annotation.Query类的一些代码示例,展示了Query类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query类的具体详情如下:
包路径:org.springframework.data.neo4j.annotation.Query
类名称:Query

Query介绍

暂无

代码示例

代码示例来源:origin: kbastani/spring-cloud-event-sourcing-example

  1. @Query("MATCH (product:Product),\n" +
  2. "\t(product)<-[:PRODUCT_TYPE]-(inventory:Inventory)\n" +
  3. "WHERE product.productId in {productIds} AND NOT (inventory)<-[:CONTAINS_PRODUCT]-()\n" +
  4. "RETURN inventory")
  5. List<Inventory> getAvailableInventoryForProductList(@Param("productIds") String[] productIds);
  6. }

代码示例来源:origin: spring-projects/spring-data-neo4j

  1. public String getCountQueryString() {
  2. return queryAnnotation != null ? queryAnnotation.countQuery() : null;
  3. }

代码示例来源:origin: spring-projects/spring-data-neo4j

  1. public String getQuery() {
  2. return queryAnnotation.value();
  3. }

代码示例来源:origin: kbastani/spring-cloud-event-sourcing-example

  1. @Query("MATCH (product:Product),\n" +
  2. "\t(product)<-[:PRODUCT_TYPE]-(inventory:Inventory)\n" +
  3. "WHERE product.productId = {productId} AND NOT (inventory)<-[:CONTAINS_PRODUCT]-()\n" +
  4. "RETURN inventory")
  5. List<Inventory> getAvailableInventoryForProduct(@Param("productId") String productId);

代码示例来源:origin: org.springframework.data/spring-data-neo4j

  1. public String getCountQueryString() {
  2. return queryAnnotation != null ? queryAnnotation.countQuery() : null;
  3. }

代码示例来源:origin: org.springframework.data/spring-data-neo4j

  1. public String getQuery() {
  2. return queryAnnotation.value();
  3. }

代码示例来源:origin: kbastani/spring-cloud-event-sourcing-example

  1. @Query("MATCH (product:Product),\n" +
  2. "\t(product)<-[:PRODUCT_TYPE]-(inventory:Inventory),\n" +
  3. " (inventory)-[:STOCKED_IN]->(:Warehouse { name: \"{warehouseName}\" })\n" +
  4. "WHERE product.productId = {productId} AND NOT (inventory)<-[:CONTAINS_PRODUCT]-()\n" +
  5. "RETURN inventory")
  6. List<Inventory> getAvailableInventoryForProductAndWarehouse(@Param("productId") String productId,
  7. @Param("warehouseName") String warehouseName);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query(value =
  2. "START sourceContent=node({0}) MATCH sourceContent - [r:similarityRelation] - targetContent "
  3. + "WHERE r.strength > {1} AND r.type = {2} "
  4. + "RETURN r",
  5. countQuery =
  6. "START sourceContent=node({0}) "
  7. + "MATCH sourceContent - [r:similarityRelation] - targetContent "
  8. + "WHERE r.strength > {1} AND r.type = {2} "
  9. + "RETURN count(targetContent)")
  10. public Page<SimilarityRelation> getSimilarContents(ContentNode sourceNode, Double minimumStrength, String similarityType, Pageable pageable);

代码示例来源:origin: kbastani/spring-boot-graph-processing-example

  1. @Query("MATCH (user:User) WHERE has(user.pagerank) AND NOT has(user.screenName)\n" +
  2. "WITH user\n" +
  3. "ORDER BY user.pagerank DESC\n" +
  4. "LIMIT 1\n" +
  5. "RETURN user")
  6. User findRankedUserToCrawl();

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query("START personNode=node({0}) "
  2. + "MATCH personNode <- [r:identityRelation] - identity "
  3. + "WHERE {1} in r.versions "
  4. + "WITH DISTINCT identity "
  5. + "OPTIONAL MATCH identity - [r:identityRelation] -> (p:personType) "
  6. + "WHERE NOT has(r.versions) "
  7. + "WITH DISTINCT identity, count(r) as count "
  8. + "WHERE count = 0 "
  9. + "MATCH identity <- [cr:contentContributionRelation] - content "
  10. + "WHERE content.status <> 'HIDDEN' "
  11. + "RETURN content.type as type, COUNT(DISTINCT content) as count")
  12. List<Map<String, Object>> countAuthorContributionsByType(PersonNode node, String version);

代码示例来源:origin: opencredo/neo4j-in-action

  1. @Query( value =
  2. "MATCH (`user`)-[:`referredBy`]->(`user_referredBy`) " +
  3. "WHERE `user_referredBy`.`name` =~ {0} " +
  4. "RETURN `user`")
  5. Iterable<User> simulateFindByReferredByNameLikeWhenUsingLabelBasedStrategy(String name);

代码示例来源:origin: opencredo/neo4j-in-action

  1. @Query( value =
  2. "MATCH (`user`:`User`) " +
  3. "WHERE `user`.`name` = {0} " +
  4. "RETURN `user`")
  5. Iterable<User> simulateFindByNameWhenUsingLabelBasedStrategy(String name);

代码示例来源:origin: kbastani/spring-boot-graph-processing-example

  1. /**
  2. * Initialize the user.lastPageRank value to the current user.pagerank
  3. */
  4. @Query("MATCH (user:User) WHERE has(user.pagerank) AND has(user.screenName) AND NOT has(user.lastPageRank)\n" +
  5. "WITH collect(user) as users\n" +
  6. "FOREACH(x in users | \n" +
  7. "SET x.lastPageRank = toFloat(x.pagerank))")
  8. void setLastPageRank();

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query("START contentNode=node({0}) "
  2. + "MATCH contentNode - [:contentContributionRelation] -> (idNode:identityType) "
  3. + "MATCH idNode - [idRel:identityRelation] -> (person:personType) "
  4. + "WHERE NOT has(idRel.versions) OR {1} in idRel.versions "
  5. + "RETURN DISTINCT person")
  6. Iterable<PersonNode> findContentPersons(ContentNode node, String version);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query(value =
  2. "START sourceContent=node({0}) "
  3. + "MATCH sourceContent - [r:similarityRelation] -> targetContent "
  4. + "WHERE r.type = {1} " +
  5. "RETURN r",
  6. countQuery =
  7. "START sourceContent=node({0}) "
  8. + "MATCH sourceContent - [r:similarityRelation] -> targetContent "
  9. + "WHERE r.type = {1} "
  10. + "RETURN count(targetContent)")
  11. public Page<SimilarityRelation> getSimilarContents(ContentNode sourceNode, String similarityType, Pageable pageable);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query(value =
  2. "START sourceContent=node({0}) "
  3. + "MATCH sourceContent - [r:similarityRelation] - targetContent "
  4. + "WHERE r.strength > {1}"
  5. + "RETURN r",
  6. countQuery =
  7. "START sourceContent=node({0}) "
  8. + "MATCH sourceContent - [r:similarityRelation] - targetContent "
  9. + "WHERE r.strength > {1}"
  10. + "RETURN count(targetContent)")
  11. public Page<SimilarityRelation> getSimilarContents(ContentNode sourceNode, Double minimumStrength, Pageable pageable);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query(value = "MATCH (cited:contentType) <- [c:citationRelation] - (target:citationType)"
  2. + " <- [ref:referenceRelation] - (source:contentType)"
  3. + " WHERE {0} in c.types"
  4. + " WITH cited, count(distinct source) as count"
  5. + " RETURN count, cited.id as id",
  6. countQuery="MATCH (cited:contentType) <- [c:citationRelation] - (target:citationType)"
  7. + " <- [ref:referenceRelation] - (source:contentType)"
  8. + " WHERE {0} in c.types"
  9. + " WITH cited, count(distinct source) as count"
  10. + " RETURN count(cited)",
  11. elementClass = Citation.class)
  12. public Page<Citation> getMostCitedPublications(String citationType, Pageable pageable);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query("START sourcePerson=node({0}) " +
  2. "MATCH sourcePerson -[toIdentity:identityRelation] - identity " +
  3. "MATCH identity -[toPerson:identityRelation] - targetPerson " +
  4. "WHERE {1} IN toPerson.versions " +
  5. "RETURN targetPerson LIMIT 1")
  6. PersonNode findCurrentPerson(PersonNode sourceNode, String requiredVersion);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query("START userNode=node({0}) "
  2. + "MATCH userNode <- [r:identityRelation] - identity "
  3. + "WHERE NOT has(r.versions) "
  4. + "MATCH identity <- [cr:contentContributionRelation] - content "
  5. + "WHERE content.status <> 'HIDDEN'"
  6. + "RETURN content.type as type, COUNT(DISTINCT content) as count")
  7. List<Map<String, Object>> countUserContributionsByType(UserNode node);

代码示例来源:origin: pl.edu.icm.synat/synat-neo4j-graph-impl

  1. @Query(value =
  2. "START sourceContent=node({0}) "
  3. + "MATCH sourceContent - [r:similarityRelation] - targetContent "
  4. + "RETURN r",
  5. countQuery =
  6. "START sourceContent=node({0}) "
  7. + "MATCH sourceContent - [r:similarityRelation] - targetContent "
  8. + "RETURN count(targetContent)")
  9. public Page<SimilarityRelation> getSimilarContents(ContentNode sourceNode, Pageable pageable);

相关文章