本文整理汇总了Java中org.springframework.data.neo4j.annotation.Query类的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于org.springframework.data.neo4j.annotation包,在下文中一共展示了Query类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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);
示例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();
示例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);
示例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);