The first is an interface
Public interface Result extends Iterator{
ListKeys ();
Boolean hasNext ();
Record next ();
Record in use () throws NoSuchRecordException;
Record the peek ();
StreamThe stream ();
ListThe list (); List The list (Function Var1);
ResultSummary consume ();
}
This Result is used to receive query returns data, I use the first list (), namely List
The second is how to use excuse me?
String sqlText="MATCH (N: WechatDepartment) - [child] - & gt; (M: WechatDepartment) \ n + "
"WHERE N.d epartmentId={departmentId} \ n" +
"RETURN ID (M) as ID, m. epartmentId as departmentId, M.n ame as the name, M.o rder as order, M.e nable as enable";
Result the Result=session. The run (sqlText paramentMap);
//method 1
ListRecords.=the result list ();
System. The out. Println (" records: "+ records. The size ());
For (Record Record: records) {
MapRecordMap=record. AsMap ();
System. The out. Println (recordMap);
String name=record. Get (" name "). The asString ();
System. The out. Println (" name: "+ name);
}
//method 2
?????
CodePudding user response:
Functional programming, can pass in a logical,Proposal set point check the forEach method, can understand
CodePudding user response: