Commit e4b01d0b by mahx

修改临时关系类型

parent cd23bb41
package com.keymobile.metadata.metadataRelation.pojo;
import org.neo4j.ogm.annotation.RelationshipEntity;
/**
* @author mahx
* @version 1.0
* @date 2021/11/29 17:14
*/
@RelationshipEntity(type = "TempRelation")
public class TempRelation extends BaseRelationship {
}
package com.keymobile.metadata.metadataRelation.respository;
import com.keymobile.metadata.metadataRelation.pojo.TempRelation;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
/**
* @author mahx
* @version 1.0
* @date 2021/11/12 17:54
*/
public interface TempRelationRepository extends Neo4jRepository<TempRelation, Long> {
@Query("match (source:BaseNode),(target:BaseNode) where id(source)=$sourceId and id(target)=$targetId merge p=(source)-[r:TempRelation]->(target) return p")
TempRelation mergeTempRelation(@Param("sourceId") Long sourceId, @Param("targetId") Long targetId);
}
...@@ -52,6 +52,8 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -52,6 +52,8 @@ public class MetadataServiceImpl implements IMetadataService {
private ExecuteRelationRepository executeRelationRepository; private ExecuteRelationRepository executeRelationRepository;
@Autowired @Autowired
private TempNodeRepository tempNodeRepository; private TempNodeRepository tempNodeRepository;
@Autowired
private TempRelationRepository tempRelationRepository;
@Autowired @Autowired
private PreRelationRepository preRelationRepository; private PreRelationRepository preRelationRepository;
...@@ -808,13 +810,13 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -808,13 +810,13 @@ public class MetadataServiceImpl implements IMetadataService {
if ("Input".equalsIgnoreCase(type)) { if ("Input".equalsIgnoreCase(type)) {
Long nodeId = createNode(nameIdMap, catalogName, etlJobId, etlScriptId, source, false, null); Long nodeId = createNode(nameIdMap, catalogName, etlJobId, etlScriptId, source, false, null);
if (nodeId != null) { if (nodeId != null) {
inputRelationReRepository.mergeInputRelation(nodeId, id); tempRelationRepository.mergeTempRelation(nodeId, id);
} }
} }
if ("Output".equalsIgnoreCase(type)) { if ("Output".equalsIgnoreCase(type)) {
Long nodeId = createNode(nameIdMap, catalogName, etlJobId, etlScriptId, target, false, null); Long nodeId = createNode(nameIdMap, catalogName, etlJobId, etlScriptId, target, false, null);
if (nodeId != null) { if (nodeId != null) {
outputRelationRepository.mergeOutRelation(id, nodeId); tempRelationRepository.mergeTempRelation(id, nodeId);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment