Package cn.net.pap.neo4j.repository
Interface HLMRelationshipRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<HLMRelationshipEntity,
,Long> org.springframework.data.neo4j.repository.Neo4jRepository<HLMRelationshipEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<HLMRelationshipEntity,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<HLMRelationshipEntity>
,org.springframework.data.repository.Repository<HLMRelationshipEntity,
Long>
public interface HLMRelationshipRepository
extends org.springframework.data.neo4j.repository.Neo4jRepository<HLMRelationshipEntity,Long>
-
Method Summary
Modifier and TypeMethodDescriptionfindByStartNodeName
(String startNodeName) 根据 startNode.name 查询关联节点,并制定节点方向查询所有关系 去重getShortestPathBetweenNodesByName
(String startNodeName, String endNodeName) 节点路径 最短距离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
-
findByStartNodeName
@Query("MATCH (HLM { name: {startNodeName} })-[r]->(node) RETURN DISTINCT node AS node, r.type AS nodeType, \'OUT\' AS direction UNION MATCH (HLM { name: {startNodeName} })<-[r]-(node) RETURN DISTINCT node AS node, r.type AS nodeType, \'IN\' AS direction ") List<HLMNodeWithTypeDTO> findByStartNodeName(String startNodeName) 根据 startNode.name 查询关联节点,并制定节点方向- Parameters:
startNodeName
-- Returns:
-
getShortestPathBetweenNodesByName
@Query("match p = shortestpath((a:HLM)-[r*0..4]-(b:HLM)) where a.name = {startNodeName} and b.name={endNodeName} return p") List<List<org.neo4j.driver.internal.value.PathValue>> getShortestPathBetweenNodesByName(@Param("startNodeName") String startNodeName, @Param("endNodeName") String endNodeName) 节点路径 最短距离- Parameters:
startNodeName
-endNodeName
-- Returns:
-
getDistinctRelationshipType
查询所有关系 去重- Returns:
-