Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neo4jRelation
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qiuchaofei
neo4jRelation
Commits
e4b01d0b
Commit
e4b01d0b
authored
Nov 29, 2021
by
mahx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改临时关系类型
parent
cd23bb41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
TempRelation.java
...eymobile/metadata/metadataRelation/pojo/TempRelation.java
+12
-0
TempRelationRepository.java
.../metadataRelation/respository/TempRelationRepository.java
+17
-0
MetadataServiceImpl.java
...ta/metadataRelation/service/impl/MetadataServiceImpl.java
+4
-2
No files found.
src/main/java/com/keymobile/metadata/metadataRelation/pojo/TempRelation.java
0 → 100644
View file @
e4b01d0b
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
{
}
src/main/java/com/keymobile/metadata/metadataRelation/respository/TempRelationRepository.java
0 → 100644
View file @
e4b01d0b
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
);
}
src/main/java/com/keymobile/metadata/metadataRelation/service/impl/MetadataServiceImpl.java
View file @
e4b01d0b
...
@@ -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
.
mergeInput
Relation
(
nodeId
,
id
);
tempRelationRepository
.
mergeTemp
Relation
(
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
.
mergeOut
Relation
(
id
,
nodeId
);
tempRelationRepository
.
mergeTemp
Relation
(
id
,
nodeId
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment