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
84270a6f
Commit
84270a6f
authored
May 13, 2022
by
qiuchaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.系统显示schema做排序
parent
5f3baaa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
Neo4jSchema.java
.../metadata/metadataRelation/pojo/metadata/Neo4jSchema.java
+21
-1
SystemServiceImpl.java
...data/metadataRelation/service/impl/SystemServiceImpl.java
+11
-0
No files found.
src/main/java/com/keymobile/metadata/metadataRelation/pojo/metadata/Neo4jSchema.java
View file @
84270a6f
...
@@ -4,7 +4,7 @@ import com.keymobile.metadata.metadataRelation.pojo.BaseNode;
...
@@ -4,7 +4,7 @@ import com.keymobile.metadata.metadataRelation.pojo.BaseNode;
import
org.neo4j.ogm.annotation.NodeEntity
;
import
org.neo4j.ogm.annotation.NodeEntity
;
@NodeEntity
(
label
=
"Neo4jSchema"
)
@NodeEntity
(
label
=
"Neo4jSchema"
)
public
class
Neo4jSchema
extends
BaseNode
{
public
class
Neo4jSchema
extends
BaseNode
implements
Comparable
<
Neo4jSchema
>
{
public
String
getLabel
()
{
public
String
getLabel
()
{
return
label
;
return
label
;
...
@@ -15,4 +15,24 @@ public class Neo4jSchema extends BaseNode {
...
@@ -15,4 +15,24 @@ public class Neo4jSchema extends BaseNode {
}
}
//分层
//分层
private
String
label
;
private
String
label
;
@Override
public
int
compareTo
(
Neo4jSchema
o
)
{
//先按照年龄排序
Integer
i
=
o
.
getName
().
compareTo
(
this
.
getName
());
if
(
i
==
0
)
{
//如果Name相等,则按照id排序
i
=
o
.
getId
().
compareTo
(
this
.
getId
());
if
(
i
==
0
)
{
//如果id相等,则按照CnName排序
i
=
o
.
getCnName
().
compareTo
(
this
.
getCnName
());
}
}
/**
* i等于0的时候表示相等;
* i等于1的时候表示大于;
* i等于-1的时候表示小于;
*/
return
i
;
}
}
}
src/main/java/com/keymobile/metadata/metadataRelation/service/impl/SystemServiceImpl.java
View file @
84270a6f
...
@@ -43,6 +43,17 @@ public class SystemServiceImpl implements ISystemService {
...
@@ -43,6 +43,17 @@ public class SystemServiceImpl implements ISystemService {
catch
(
Exception
e
){
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
System
.
out
.
println
(
"排序前:"
);
for
(
Neo4jSchema
neo4jSchema:
neo4jSchemaList
){
System
.
out
.
println
(
"排序前:"
+
neo4jSchema
.
getName
());
}
Collections
.
sort
(
neo4jSchemaList
);
System
.
out
.
println
(
"排序后:"
);
for
(
Neo4jSchema
neo4jSchema:
neo4jSchemaList
){
System
.
out
.
println
(
"排序后:"
+
neo4jSchema
.
getName
());
}
for
(
Neo4jSchema
neo4jSchema:
neo4jSchemaList
){
for
(
Neo4jSchema
neo4jSchema:
neo4jSchemaList
){
ReturnNode
returnNode
=
new
ReturnNode
();
ReturnNode
returnNode
=
new
ReturnNode
();
...
...
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