• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Query类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.data.neo4j.annotation.Query的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Query类属于org.springframework.data.neo4j.annotation包,在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: copyDesignSpaceToSnapshot

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (input:DesignSpace {spaceID: {inputSpaceID}})-[:ARCHIVES]->(bo:Branch {branchID: {outputBranchID}})-[:LATEST]->(co:Commit)-[:CONTAINS]->(so:Snapshot {idIndex: 0}), (bo)-[:CONTAINS]->(co) "
    + "SET so.idIndex = input.idIndex "
    + "WITH input, so "
    + "MATCH (input)-[:CONTAINS]->(n:Node) "
    +
    "FOREACH(ignoreMe IN CASE WHEN NOT exists(n.nodeType) THEN [1] ELSE [] END | "
    + "CREATE (so)-[:CONTAINS]->(:Node {nodeID: n.nodeID})) "
    +
    "FOREACH(ignoreMe IN CASE WHEN exists(n.nodeType) THEN [1] ELSE [] END | "
    +
    "CREATE (so)-[:CONTAINS]->(:Node {nodeID: n.nodeID, nodeType: n.nodeType})) "
    + "WITH input, so, n as m "
    + "MATCH (m)-[e:PRECEDES]->(n:Node)<-[:CONTAINS]-(target) "
    +
    "FOREACH(ignoreMe IN CASE WHEN NOT exists(e.componentIDs) AND NOT exists(e.componentRoles) THEN [1] ELSE [] END | "
    +
    "CREATE UNIQUE (so)-[:CONTAINS]->(:Node {nodeID: m.nodeID})-[:PRECEDES]->(:Node {nodeID: n.nodeID})<-[:CONTAINS]-(so)) "
    +
    "FOREACH(ignoreMe IN CASE WHEN exists(e.componentIDs) AND exists(e.componentRoles) THEN [1] ELSE [] END | "
    +
    "CREATE UNIQUE (so)-[:CONTAINS]->(:Node {nodeID: m.nodeID})-[:PRECEDES {componentIDs: e.componentIDs, componentRoles: e.componentRoles}]->(:Node {nodeID: n.nodeID})<-[:CONTAINS]-(so))")
void copyDesignSpaceToSnapshot(@Param("inputSpaceID") String inputSpaceID,
                               @Param("outputBranchID")
                               String outputBranchID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:26,代码来源:DesignSpaceRepository.java


示例2: mergeBranch

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (target:DesignSpace {spaceID: {targetSpaceID}})-[:ARCHIVES]->(bi:Branch {branchID: {inputBranchID}}) "
    + "WITH target, bi "
    +
    "MERGE (target)-[:ARCHIVES]->(bo:Branch {branchID: {outputBranchID}}) "
    + "ON CREATE SET bo.idIndex = bi.idIndex "
    +
    "FOREACH(ignoreMe IN CASE WHEN bo.idIndex < bi.idIndex THEN [1] ELSE [] END | "
    + "SET bo.idIndex = bi.idIndex) "
    + "WITH bi, bo "
    + "MATCH (bi)-[:LATEST]->(ci:Commit)<-[:CONTAINS]-(bi) "
    + "CREATE UNIQUE (bo)-[:LATEST]->(ci)<-[:CONTAINS]-(bo) "
    + "WITH bi, bo "
    + "MATCH (bi)-[:CONTAINS]->(ci:Commit) "
    + "WHERE NOT (bi)-[:LATEST]->(ci) "
    + "CREATE UNIQUE (bo)-[:CONTAINS]->(ci)")
void mergeBranch(@Param("targetSpaceID") String targetSpaceID,
                 @Param("inputBranchID") String inputBranchID,
                 @Param("outputBranchID") String outputBranchID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:20,代码来源:DesignSpaceRepository.java


示例3: MERGE

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
/**
 * Creates link in database.
 *
 * @param sourceNode        source switch datapath id
 * @param destinationNode   destination switch datapath id
 * @param sourceSwitch      source switch datapath id
 * @param sourcePort        source switch port
 * @param destinationSwitch destination switch datapath id
 * @param destinationPort   destination switch port
 * @param latency           link latency
 * @param speed             port speed
 * @param bandwidth         available bandwidth
 */
@Query("MATCH ( u:switch { name: {src_node} } ), ( r:switch { name: {dst_node} } ) MERGE (u)-[:isl " +
        "{ src_port: {src_port}, dst_port: {dst_port}, src_switch: {src_switch}, dst_switch: {dst_switch}, " +
        "latency: {latency}, speed: {speed}, bandwidth: {bandwidth} } " +
        "]->(r)")
void creteIsl(@Param("src_node") String sourceNode,
              @Param("dst_node") String destinationNode,
              @Param("src_switch") String sourceSwitch,
              @Param("src_port") int sourcePort,
              @Param("dst_switch") String destinationSwitch,
              @Param("dst_port") int destinationPort,
              @Param("latency") long latency,
              @Param("speed") long speed,
              @Param("bandwidth") long bandwidth);
 
开发者ID:telstra,项目名称:open-kilda,代码行数:27,代码来源:IslRepository.java


示例4: NOT

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query("MATCH (product:Product),\n" +
        "\t(product)<-[:PRODUCT_TYPE]-(inventory:Inventory),\n" +
        "    (inventory)-[:STOCKED_IN]->(:Warehouse { name: \"{warehouseName}\" })\n" +
        "WHERE product.productId = {productId} AND NOT (inventory)<-[:CONTAINS_PRODUCT]-()\n" +
        "RETURN inventory")
List<Inventory> getAvailableInventoryForProductAndWarehouse(@Param("productId") String productId,
                                                            @Param("warehouseName") String warehouseName);
 
开发者ID:kbastani,项目名称:spring-cloud-event-sourcing-example,代码行数:8,代码来源:InventoryRepository.java


示例5: has

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query("MATCH (user:User) WHERE has(user.screenName)\n" +
        "WITH user\n" +
        "ORDER BY user.screenName ASC\n" +
        "SKIP {skip}\n" +
        "LIMIT {limit}\n" +
        "RETURN user")
Set<User> findAllUsers(@Param("skip") Integer skip, @Param("limit") Integer limit);
 
开发者ID:163yun,项目名称:cloud-native-app-sample,代码行数:8,代码来源:UserRepository.java


示例6: COUNT

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
        "MATCH (i:Indicator)<-[r :HAS_FINDING|:HAS_SYM_OR_SIGN]-(:Disease)" +
                "\nRETURN i AS indicator, COUNT(r) AS score" +
                "\nORDER BY score DESC" +
                "\nSKIP {skip}" +
                "\nLIMIT {limit}")
Collection<IndicatorWithScoreDTO> findMostRelevantIndicators(@Param("skip") int skip, @Param("limit") int limit);
 
开发者ID:guidj,项目名称:kelsey-portal,代码行数:8,代码来源:IndicatorRepository.java


示例7: COUNT

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
        "MATCH (d:Disease {cui:{cui}})-[:HAS_FINDING|:HAS_SYM_OR_SIGN]->(i:Indicator)<-[:HAS_FINDING|:HAS_SYM_OR_SIGN]-(o:Disease)" +
                "\nWHERE d <> o" +
                "\nRETURN DISTINCT o AS disease, COUNT(i) AS score" +
                "\nORDER BY score DESC" +
                "\nSKIP {skip}" +
                "\nLIMIT {limit}")
Collection<DiseaseWithScoreDTO> findSimilarDiseases(@Param("cui") String cui, @Param("skip") int skip, @Param("limit") int limit);
 
开发者ID:guidj,项目名称:kelsey-portal,代码行数:9,代码来源:DiseaseRepository.java


示例8: ID

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
        "MATCH (d:Disease)-[:HAS_FINDING|:HAS_SYM_OR_SIGN]->(i:Indicator)<-[:HAS_FINDING|:HAS_SYM_OR_SIGN]-(o:Disease)" +
                "\nWHERE d <> o AND ID(d) < ID(o)" +
                "\nRETURN d AS disease, o AS other, COUNT(i) AS score" +
                "\nORDER BY score DESC" +
                "\nSKIP {skip}" +
                "\nLIMIT {limit}")
Collection<DiseasePairWithScoreDTO> findSimilarDiseases(@Param("skip") int skip, @Param("limit") int limit);
 
开发者ID:guidj,项目名称:kelsey-portal,代码行数:9,代码来源:DiseaseRepository.java


示例9: NOT

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH "
        + "(child:Commit {name:{0}})-[:IS_CHILD_OF*]->(parent:Commit), "
        + "(parent)-[:TOUCHED]->(file:File), "
        + "(snapshot:FileSnapshot)-[snapshotOfFile:SNAPSHOT_OF_FILE]->(file)"
        + "WHERE NOT ((file)-[:DELETED_IN_COMMIT]->()) "
        + "RETURN snapshot, snapshotOfFile, file")
Set<FileSnapshotNode> notDeletedInPreviousCommits(String commitName);
 
开发者ID:reflectoring,项目名称:coderadar,代码行数:9,代码来源:FileSnapshotNodeRepository.java


示例10: MATCH

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (c:Commit {name:{0}})"
        + "OPTIONAL MATCH (addedFile:File)-[:ADDED_IN_COMMIT]->(c)"
        + "OPTIONAL MATCH (modifiedFile:File)-[:MODIFIED_IN_COMMIT]->(c)"
        + "OPTIONAL MATCH (deletedFile:File)-[:DELETED_IN_COMMIT]->(c)"
        + "OPTIONAL MATCH (renamedFile:File)-[:RENAMED_IN_COMMIT]->(c)"
        + "RETURN "
        + "count(addedFile) as addedFiles, "
        + "count(modifiedFile) as modifiedFiles, "
        + "count(deletedFile) as deletedFiles, "
        + "count(renamedFile) as renamedFiles")
TouchedFilesCountQueryResult countTouchedFiles(String commitName);
 
开发者ID:reflectoring,项目名称:coderadar,代码行数:13,代码来源:FileNodeRepository.java


示例11: NOT

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH "
        + "(child:Commit {name:{0}})-[:IS_CHILD_OF*]->(parent:Commit), "
        + "(parent)-[:TOUCHED]->(file:File) "
        + "WHERE NOT ((file)-[:DELETED_IN_COMMIT]->()) "
        + "RETURN file")
Set<FileNode> notDeletedInPreviousCommits(String commitName);
 
开发者ID:reflectoring,项目名称:coderadar,代码行数:8,代码来源:FileNodeRepository.java


示例12: has

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query("MATCH (user:User) WHERE has(user.pagerank) AND has(user.screenName) AND coalesce(user.imported, false) = true\n" +
        "WITH user\n" +
        "ORDER BY user.pagerank DESC\n" +
        "SKIP {skip}\n" +
        "LIMIT {limit}\n" +
        "RETURN user")
Set<User> findRankedUsers(@Param("skip") Integer skip, @Param("limit") Integer limit);
 
开发者ID:kbastani,项目名称:spring-boot-graph-processing-example,代码行数:8,代码来源:UserRepository.java


示例13: findNextUserToCrawl

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query("MATCH (a:User)<-[r:FOLLOWS]-(b)\n" +
        "WHERE NOT has(a.screenName)\n" +
        "WITH a, count(r) as weight\n" +
        "WHERE weight > 2\n" +
        "WITH a, weight\n" +
        "ORDER BY weight DESC\n" +
        "LIMIT 1\n" +
        "WITH a\n" +
        "RETURN a")
User findNextUserToCrawl();
 
开发者ID:kbastani,项目名称:spring-boot-graph-processing-example,代码行数:11,代码来源:UserRepository.java


示例14: checkoutBranch

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (s:Snapshot)<-[:CONTAINS]-(c:Commit)<-[:CONTAINS]-(b:Branch {branchID: {targetBranchID}})<-[:ARCHIVES]-(target:DesignSpace {spaceID: {targetSpaceID}})-[h:SELECTS]->(:Branch), (b)-[:LATEST]->(c) "
    + "DELETE h "
    + "CREATE (target)-[:SELECTS]->(b) "
    + "SET target.idIndex = s.idIndex "
    + "WITH target, s "
    + "MATCH (s)-[:CONTAINS]->(n:Node) "
    +
    "FOREACH(ignoreMe IN CASE WHEN NOT exists(n.nodeType) THEN [1] ELSE [] END | "
    +
    "CREATE (target)-[:CONTAINS]->(:Node {nodeID: n.nodeID, copyIndex: ID(n)})) "
    +
    "FOREACH(ignoreMe IN CASE WHEN exists(n.nodeType) THEN [1] ELSE [] END | "
    +
    "CREATE (target)-[:CONTAINS]->(:Node {nodeID: n.nodeID, copyIndex: ID(n), nodeType: n.nodeType})) "
    + "WITH target, s, n as m "
    + "MATCH (m)-[e:PRECEDES]->(n:Node)<-[:CONTAINS]-(s) "
    +
    "FOREACH(ignoreMe IN CASE WHEN NOT exists(e.componentIDs) AND NOT exists(e.componentRoles) THEN [1] ELSE [] END | "
    +
    "CREATE UNIQUE (target)-[:CONTAINS]->(:Node {copyIndex: ID(m)})-[:PRECEDES]->(:Node {copyIndex: ID(n)})<-[:CONTAINS]-(target)) "
    +
    "FOREACH(ignoreMe IN CASE WHEN exists(e.componentIDs) AND exists(e.componentRoles) THEN [1] ELSE [] END | "
    +
    "CREATE UNIQUE (target)-[:CONTAINS]->(:Node {copyIndex: ID(m)})-[:PRECEDES {componentIDs: e.componentIDs, componentRoles: e.componentRoles}]->(:Node {copyIndex: ID(n)})<-[:CONTAINS]-(target))")
void checkoutBranch(@Param("targetSpaceID") String targetSpaceID,
                    @Param("targetBranchID") String targetBranchID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:28,代码来源:DesignSpaceRepository.java


示例15: copyHeadBranch

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (target:DesignSpace {spaceID: {targetSpaceID}})-[:SELECTS]->(hb:Branch)-[:LATEST]->(lc:Commit), (target)-[:ARCHIVES]->(hb), (hb)-[:CONTAINS]->(lc) "
    +
    "CREATE (target)-[:ARCHIVES]->(b:Branch {branchID: {outputBranchID}, idIndex: hb.idIndex}) "
    + "CREATE (lc)<-[:LATEST]-(b)-[:CONTAINS]->(lc) "
    + "WITH hb, b "
    + "MATCH (hb)-[:CONTAINS]->(c:Commit) "
    + "WHERE NOT (hb)-[:LATEST]->(c) "
    + "CREATE (b)-[:CONTAINS]->(c)")
void copyHeadBranch(@Param("targetSpaceID") String targetSpaceID,
                    @Param("outputBranchID") String outputBranchID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:12,代码来源:DesignSpaceRepository.java


示例16: copySnapshots

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (:DesignSpace {spaceID: {inputSpaceID}})-[:ARCHIVES]->(:Branch {branchID: {inputBranchID}})-[:CONTAINS]->(ci:Commit)-[:CONTAINS]->(si:Snapshot) "
    + "WITH ci, si "
    +
    "MATCH (:DesignSpace {spaceID: {outputSpaceID}})-[:ARCHIVES]->(:Branch {branchID: {outputBranchID}})-[:CONTAINS]->(co:Commit {copyIndex: ID(ci)})-[:CONTAINS]->(so:Snapshot {idIndex: 0}) "
    + "SET so.idIndex = si.idIndex "
    + "WITH si, so "
    + "MATCH (si)-[:CONTAINS]->(n:Node) "
    +
    "FOREACH(ignoreMe IN CASE WHEN NOT exists(n.nodeType) THEN [1] ELSE [] END | "
    + "CREATE (so)-[:CONTAINS]->(:Node {nodeID: n.nodeID})) "
    +
    "FOREACH(ignoreMe IN CASE WHEN exists(n.nodeType) THEN [1] ELSE [] END | "
    +
    "CREATE (so)-[:CONTAINS]->(:Node {nodeID: n.nodeID, nodeType: n.nodeType})) "
    + "WITH si, so, n as m "
    + "MATCH (m)-[e:PRECEDES]->(n:Node)<-[:CONTAINS]-(si) "
    +
    "FOREACH(ignoreMe IN CASE WHEN NOT exists(e.componentIDs) AND NOT exists(e.componentRoles) THEN [1] ELSE [] END | "
    +
    "CREATE UNIQUE (so)-[:CONTAINS]->(:Node {nodeID: m.nodeID})-[:PRECEDES]->(:Node {nodeID: n.nodeID})<-[:CONTAINS]-(so)) "
    +
    "FOREACH(ignoreMe IN CASE WHEN exists(e.componentIDs) AND exists(e.componentRoles) THEN [1] ELSE [] END | "
    +
    "CREATE UNIQUE (so)-[:CONTAINS]->(:Node {nodeID: m.nodeID})-[:PRECEDES {componentIDs: e.componentIDs, componentRoles: e.componentRoles}]->(:Node {nodeID: n.nodeID})<-[:CONTAINS]-(so))")
void copySnapshots(@Param("inputSpaceID") String inputSpaceID,
                   @Param("inputBranchID") String inputBranchID,
                   @Param("outputSpaceID") String outputSpaceID,
                   @Param("outputBranchID") String outputBranchID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:30,代码来源:DesignSpaceRepository.java


示例17: createCommit

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (target:DesignSpace {spaceID: {targetSpaceID}})-[:ARCHIVES]->(b:Branch {branchID: {targetBranchID}}) "
    +
    "CREATE (b)-[:LATEST]->(c:Commit {commitID: 'c'+ b.idIndex})<-[:CONTAINS]-(b) "
    + "CREATE (c)-[:CONTAINS]->(s:Snapshot {idIndex: 0}) "
    + "SET b.idIndex = b.idIndex + 1 "
    + "WITH b, c "
    + "MATCH (b)-[l:LATEST]->(d:Commit)<-[:CONTAINS]-(b) "
    + "WHERE NOT ID(c) = ID(d) "
    + "FOREACH(ignoreMe IN CASE WHEN l IS NOT NULL THEN [1] ELSE [] END | "
    + "DELETE l) "
    + "FOREACH(ignoreMe IN CASE WHEN d IS NOT NULL THEN [1] ELSE [] END | "
    + "CREATE (c)-[:SUCCEEDS]->(d))")
void createCommit(@Param("targetSpaceID") String targetSpaceID,
                  @Param("targetBranchID") String targetBranchID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:16,代码来源:DesignSpaceRepository.java


示例18: createComponentEdge

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (tail:Node {nodeID: {targetTailID}})<-[:CONTAINS]-(:DesignSpace {spaceID: {targetSpaceID}})-[:CONTAINS]->(head:Node {nodeID: {targetHeadID}}) "
    +
    "CREATE (tail)-[:PRECEDES {componentIDs: {componentIDs}, componentRoles: {componentRoles}}]->(head)")
void createComponentEdge(
    @Param("targetSpaceID") String targetSpaceID,
    @Param("targetTailID") String targetTailID,
    @Param("targetHeadID") String targetHeadID,
    @Param("componentIDs") ArrayList<String> componentIDs,
    @Param("componentRoles") ArrayList<String> componentRoles);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:11,代码来源:DesignSpaceRepository.java


示例19: createDesignSpace

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "CREATE (output:DesignSpace {spaceID: {outputSpaceID}, idIndex: 2, mergeIndex: 0})-[:ARCHIVES]->(b:Branch {branchID: {outputSpaceID}, idIndex: 0}) "
    + "CREATE (output)-[:SELECTS]->(b) "
    +
    "CREATE (output)-[:CONTAINS]->(m:Node {nodeID: 'n0', nodeType: 'start'}) "
    +
    "CREATE (output)-[:CONTAINS]->(n:Node {nodeID: 'n1', nodeType: 'accept'}) "
    +
    "CREATE (m)-[:PRECEDES {componentIDs: {componentIDs}, componentRoles: {componentRoles}}]->(n)")
void createDesignSpace(
    @Param("outputSpaceID") String outputSpaceID,
    @Param("componentIDs") ArrayList<String> componentIDs,
    @Param("componentRoles") ArrayList<String> componentRoles);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:14,代码来源:DesignSpaceRepository.java


示例20: createNode

import org.springframework.data.neo4j.annotation.Query; //导入依赖的package包/类
@Query(
    "MATCH (target:DesignSpace {spaceID: {targetSpaceID}}) "
    +
    "CREATE (target)-[:CONTAINS]->(n:Node {nodeID: 'n' + target.idIndex}) "
    + "SET target.idIndex = target.idIndex + 1 "
    + "RETURN n.nodeID as nodeID")
String createNode(@Param("targetSpaceID") String targetSpaceID);
 
开发者ID:CIDARLAB,项目名称:knox,代码行数:8,代码来源:DesignSpaceRepository.java



注:本文中的org.springframework.data.neo4j.annotation.Query类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SupportFragmentTestUtil类代码示例发布时间:2022-05-21
下一篇:
Java Customizer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap