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
1c6cc46a
Commit
1c6cc46a
authored
Jun 13, 2022
by
qiuchaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.同步表与表,2.修改从mongo读数的方式,3修改dependency的存储方式。
parent
b196d6db
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
3 deletions
+82
-3
DependencyRelation.java
...le/metadata/metadataRelation/pojo/DependencyRelation.java
+23
-1
DependencyRelationResposity.java
...dataRelation/respository/DependencyRelationResposity.java
+7
-0
IMetadataService.java
...e/metadata/metadataRelation/service/IMetadataService.java
+2
-0
MetadataServiceImpl.java
...ta/metadataRelation/service/impl/MetadataServiceImpl.java
+0
-0
MongoDbServiceImpl.java
...ata/metadataRelation/service/impl/MongoDbServiceImpl.java
+50
-2
No files found.
src/main/java/com/keymobile/metadata/metadataRelation/pojo/DependencyRelation.java
View file @
1c6cc46a
...
...
@@ -2,6 +2,28 @@ package com.keymobile.metadata.metadataRelation.pojo;
import
org.neo4j.ogm.annotation.RelationshipEntity
;
@RelationshipEntity
(
type
=
"
Dependency
"
)
@RelationshipEntity
(
type
=
"
流向
"
)
public
class
DependencyRelation
extends
BaseRelationship
{
private
String
jobId
;
public
String
getJobId
()
{
return
jobId
;
}
public
void
setJobId
(
String
jobId
)
{
this
.
jobId
=
jobId
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
private
String
description
;
}
src/main/java/com/keymobile/metadata/metadataRelation/respository/DependencyRelationResposity.java
0 → 100644
View file @
1c6cc46a
package
com
.
keymobile
.
metadata
.
metadataRelation
.
respository
;
import
com.keymobile.metadata.metadataRelation.pojo.DependencyRelation
;
import
org.springframework.data.neo4j.repository.Neo4jRepository
;
public
interface
DependencyRelationResposity
extends
Neo4jRepository
<
DependencyRelation
,
Long
>
{
}
src/main/java/com/keymobile/metadata/metadataRelation/service/IMetadataService.java
View file @
1c6cc46a
...
...
@@ -108,4 +108,6 @@ public interface IMetadataService {
void
syschro1104Relations
(
String
catalogName
);
void
syschroTable2TableRelations
(
String
catalogName
);
}
src/main/java/com/keymobile/metadata/metadataRelation/service/impl/MetadataServiceImpl.java
View file @
1c6cc46a
This diff is collapsed.
Click to expand it.
src/main/java/com/keymobile/metadata/metadataRelation/service/impl/MongoDbServiceImpl.java
View file @
1c6cc46a
...
...
@@ -157,19 +157,34 @@ public class MongoDbServiceImpl {
return
mongoTemplate
.
count
(
query
,
Document
.
class
,
PREFIX_MD_RELATION_TEMP_NODE
+
catalogName
);
}
public
List
<
Document
>
findRelationByPage
(
Pageable
pageable
,
String
catalogName
)
{
public
List
<
Document
>
findRelationByPage
InputOutPut
(
Pageable
pageable
,
String
catalogName
)
{
Query
query
=
new
Query
(
new
Criteria
().
orOperator
(
Criteria
.
where
(
"type"
).
is
(
INPUT
),
Criteria
.
where
(
"type"
).
is
(
OUTPUT
)));
query
.
with
(
pageable
);
return
mongoTemplate
.
find
(
query
,
Document
.
class
,
PREFIX_MD_RELATION
+
catalogName
);
}
public
long
countRelation
(
Pageable
pageable
,
String
catalogName
)
{
public
long
countRelation
ByInputOutPut
(
Pageable
pageable
,
String
catalogName
)
{
Query
query
=
new
Query
(
new
Criteria
().
orOperator
(
Criteria
.
where
(
"type"
).
is
(
INPUT
),
Criteria
.
where
(
"type"
).
is
(
OUTPUT
)));
query
.
with
(
pageable
);
return
mongoTemplate
.
count
(
query
,
Document
.
class
,
PREFIX_MD_RELATION
+
catalogName
);
}
public
List
<
Document
>
findRelationByDependency
(
Pageable
pageable
,
String
catalogName
)
{
Query
query
=
new
Query
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"type"
).
is
(
"Dependency"
),
Criteria
.
where
(
"from"
).
is
(
"Script"
)));
query
.
with
(
pageable
);
return
mongoTemplate
.
find
(
query
,
Document
.
class
,
PREFIX_MD_RELATION
+
catalogName
);
}
public
long
countRelationByDependency
(
Pageable
pageable
,
String
catalogName
)
{
Query
query
=
new
Query
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"type"
).
is
(
"Dependency"
),
Criteria
.
where
(
"from"
).
is
(
"Script"
)));
// Query query = new Query(new Criteria().orOperator(Criteria.where("type").is(INPUT),Criteria.where("type").is(OUTPUT)));
query
.
with
(
pageable
);
return
mongoTemplate
.
count
(
query
,
Document
.
class
,
PREFIX_MD_RELATION
+
catalogName
);
}
public
long
countRelationByJobId
(
Pageable
pageable
,
String
catalogName
,
String
jobId
)
{
Query
query
=
new
Query
(
new
Criteria
()
.
andOperator
(
Criteria
.
where
(
"jobId"
).
is
(
jobId
),
new
Criteria
().
orOperator
(
Criteria
.
where
(
"type"
).
is
(
INPUT
),
Criteria
.
where
(
"type"
).
is
(
OUTPUT
))
...
...
@@ -194,4 +209,37 @@ public class MongoDbServiceImpl {
return
mongoTemplate
.
findAll
(
Document
.
class
,
"Relation"
+
catalogName
);
}
//按照字段id模糊匹配,查总数
public
long
countColumnByColumnId
(
Pageable
pageable
,
String
catalogName
,
String
columnModelPath
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"_class"
).
is
(
columnModelPath
));
query
.
with
(
pageable
);
return
mongoTemplate
.
count
(
query
,
Document
.
class
,
PREFIX_METADATA_NODE
+
catalogName
);
}
public
List
<
Document
>
findColumnByColumnIdByPage
(
Pageable
pageable
,
String
catalogName
,
String
columnModelPath
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"_class"
).
is
(
columnModelPath
));
query
.
with
(
pageable
);
return
mongoTemplate
.
find
(
query
,
Document
.
class
,
PREFIX_METADATA_NODE
+
catalogName
);
}
/**
BasicDBObject query = new BasicDBObject();
query.put(T_L, null);
FindIterable<Document> iterables = this.mongoTemplate.getCollection(name).find(query);
MongoCursor<Document> cursor = iterables.iterator();
List<Document> results = new ArrayList<>();
int i = 1;
while (cursor.hasNext()) {
results.add(cursor.next());
if (i % 30000 == 0) {
processList(results, name);
LogManager.logInfo(InitCtrl.class, name + "已处理了" + i + "条");
}
i++;
}
*/
}
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