Commit 7351c570 by qiuchaofei

1,返回结果的数量控制

parent c0d91f59
......@@ -150,12 +150,8 @@ public class MetaDataController {
Map<String, List<String>> target2Source = new HashMap<>();
Map<String, MetaModel> metaModelMap = new HashMap<>();
int count= 0;
int count= 1;
for (MetaData metaData : metaDataList) {
if(count>=sizeInt){
break;
}
count++;
Node node = new Node();
String[] strings = metaData.getMetadataId().split("=");
......@@ -185,6 +181,11 @@ public class MetaDataController {
systemNode.setType("MetaData");
returnReslult.getNodes().add(systemNode);
nodeMap.put("" + systemNode.getId(), systemNode);
count++;
if(count>=sizeInt){
break;
}
child2Parent.put("" + metaData.getId(), systemNode.getId());
}
......@@ -202,6 +203,10 @@ public class MetaDataController {
node.setName(metaData.getName());
node.setType("MetaData");
returnReslult.getNodes().add(node);
count++;
if(count>=sizeInt){
break;
}
nodeMap.put("" + metaData.getId(), node);
}
......
......@@ -175,7 +175,7 @@ public class MetadataServiceImpl implements IMetadataService {
Driver neo4jConnection = neo4jConfig.getNeo4jConnection();
Session session = neo4jConnection.session();
// match (n:MetaData ) where n.metadataId =~"Table=.*" return n
String cypher = "match (n:MetaData ) where n.metadataId =~\"" + modelName + ".*\" return n";
String cypher = "match (n:MetaData ) where n.metadataId =~\"" + modelName + ".*\" return n limit "+size;
logger.info("cypher:" + cypher);
Map<String, MetaModel> metaModelMap = new HashMap<>();
long starttime = System.currentTimeMillis();
......@@ -185,14 +185,8 @@ public class MetadataServiceImpl implements IMetadataService {
List<String> metadataIdList = new ArrayList<>();
int count0 = 0;
while (result.hasNext()) {
if(count0>=size){
break;
}
count0++;
Record record = result.next();
List<Value> values = record.values();
for (Value value : values) {
......
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