Package cn.net.pap.neo4j.repository
Interface AbsNodeRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<AbsNodeEntity,
,String> org.springframework.data.neo4j.repository.Neo4jRepository<AbsNodeEntity,
,String> org.springframework.data.repository.PagingAndSortingRepository<AbsNodeEntity,
,String> org.springframework.data.repository.query.QueryByExampleExecutor<AbsNodeEntity>
,org.springframework.data.repository.Repository<AbsNodeEntity,
String>
public interface AbsNodeRepository
extends org.springframework.data.neo4j.repository.Neo4jRepository<AbsNodeEntity,String>
-
Method Summary
Modifier and TypeMethodDescriptionfindByAbsNodeLabel
(String absNodeLabel) 根据 absNodeLabel 查询getAbsNodeWithTypeDTOsByAbsNodeLabel
(String absNodeLabel) 查询与当前节点关联的节点和关联关系getParentWithChildrens
(String absNodeLabel) 查询与当前节点关联的节点和关联关系(集合)getPathBetweenNodesByAbsNodeLabel
(String startAbsNodeLabel, String endAbsNodeLabel) 节点路径距离查询getRelationByAbsNodeLabel
(String absNodeLabel) 与 absNodeLabel 有关联的节点.getShortestPathBetweenNodesByAbsNodeLabel
(String startAbsNodeLabel, String endAbsNodeLabel) 节点路径 最短距离Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface org.springframework.data.neo4j.repository.Neo4jRepository
findAll, findAll, findAll, findAll, findAllById, saveAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByAbsNodeLabel
根据 absNodeLabel 查询- Parameters:
absNodeLabel
-- Returns:
-
getRelationByAbsNodeLabel
@Query("MATCH (absNodeEntity { absNodeLabel: {absNodeLabel} })--(node) RETURN DISTINCT node") List<AbsNodeEntity> getRelationByAbsNodeLabel(String absNodeLabel) 与 absNodeLabel 有关联的节点.- Parameters:
absNodeLabel
-- Returns:
-
getAbsNodeWithTypeDTOsByAbsNodeLabel
@Query("MATCH (absNodeEntity { absNodeLabel: {absNodeLabel} })-[r]-(node) RETURN DISTINCT node AS node, TYPE(r) AS nodeType") List<AbsNodeWithTypeDTO> getAbsNodeWithTypeDTOsByAbsNodeLabel(@Param("absNodeLabel") String absNodeLabel) 查询与当前节点关联的节点和关联关系- Parameters:
absNodeLabel
-- Returns:
-
getPathBetweenNodesByAbsNodeLabel
@Query("match p = (a:absNodeEntity)-[r*..5]-(b:absNodeEntity) where a.absNodeLabel = {startAbsNodeLabel} and b.absNodeLabel={endAbsNodeLabel} and ALL( n1 in nodes(p) where size([n2 in nodes(p) where id(n1) = id(n2)])=1 ) return p") List<List<org.neo4j.driver.internal.value.PathValue>> getPathBetweenNodesByAbsNodeLabel(@Param("startAbsNodeLabel") String startAbsNodeLabel, @Param("endAbsNodeLabel") String endAbsNodeLabel) 节点路径距离查询- Parameters:
startAbsNodeLabel
-endAbsNodeLabel
-- Returns:
-
getShortestPathBetweenNodesByAbsNodeLabel
@Query("match p = shortestpath((a:absNodeEntity)-[r*0..4]-(b:absNodeEntity)) where a.absNodeLabel = {startAbsNodeLabel} and b.absNodeLabel={endAbsNodeLabel} return p") List<List<org.neo4j.driver.internal.value.PathValue>> getShortestPathBetweenNodesByAbsNodeLabel(@Param("startAbsNodeLabel") String startAbsNodeLabel, @Param("endAbsNodeLabel") String endAbsNodeLabel) 节点路径 最短距离- Parameters:
startAbsNodeLabel
-endAbsNodeLabel
-- Returns:
-
getParentWithChildrens
@Query("MATCH (p:absNodeEntity {absNodeLabel: {absNodeLabel}})-[:childrens]->(m:absNodeEntity) RETURN {parentNode: p, childrenNodes: collect(m)} AS result;") List<Object[]> getParentWithChildrens(@Param("absNodeLabel") String absNodeLabel) 查询与当前节点关联的节点和关联关系(集合)- Parameters:
absNodeLabel
-- Returns:
-