Skip to content
Permalink
Browse files
Merge pull request #67 from isururanawaka/sharing_service_impl
Bug fix in storage fetch query
  • Loading branch information
isururanawaka committed Sep 9, 2021
2 parents 58590f3 + 6902d61 commit d5f7c53e931d00c23a68b988d4047303e6971f50
Showing 1 changed file with 6 additions and 5 deletions.
@@ -67,13 +67,14 @@ public void fetchStoragePreference(StoragePreferenceFetchRequest request, Stream

List<Record> records = this.neo4JConnector.searchNodes(userProps,
" MATCH (u:User) where u.username = $username AND u.tenantId = $tenantId" +
" OPTIONAL MATCH (u)<-[:SHARED_WITH]-(s1:Storage)<-[:CHILD_OF]->(sp1:StoragePreference) where sp1.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (cg:Group)-[:CHILD_OF*]->(g:Group)<-[:MEMBER_OF]-(u)" +
" OPTIONAL MATCH (u)<-[:SHARED_WITH]-(s1:Storage)<-[:CHILD_OF]-(sp1:StoragePreference) where sp1.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (g:Group)<-[:MEMBER_OF]-(u)" +
" OPTIONAL MATCH (cg:Group)-[:CHILD_OF*]->(g)" +
" OPTIONAL MATCH (sp2:StoragePreference)-[:CHILD_OF]->(s2:Storage)-[:SHARED_WITH]->(cg) where sp2.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (sp3:StoragePreference)-[:CHILD_OF]->(s3:Storage)-[:SHARED_WITH]->(g) where sp3.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (s4:Storage)<-[:CHILD_OF]->(sp4:StoragePreference)-[:SHARED_WITH]->(u) where sp4.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (s5:Storage)<-[:CHILD_OF]->(sp5:StoragePreference)-[:SHARED_WITH]->(cg) where sp5.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (s6:Storage)<-[:CHILD_OF]->(sp6:StoragePreference)-[:SHARED_WITH]->(g) where sp6.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (s4:Storage)<-[:CHILD_OF]-(sp4:StoragePreference)-[:SHARED_WITH]->(u) where sp4.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (s5:Storage)<-[:CHILD_OF]-(sp5:StoragePreference)-[:SHARED_WITH]->(cg) where sp5.storagePreferenceId = $storagePreferenceId" +
" OPTIONAL MATCH (s6:Storage)<-[:CHILD_OF]-(sp6:StoragePreference)-[:SHARED_WITH]->(g) where sp6.storagePreferenceId = $storagePreferenceId" +
" return distinct s1, sp1, s2, sp2, s3, sp3, s4,sp4, s5,sp5, s6,sp6");

if (!records.isEmpty()) {

0 comments on commit d5f7c53

Please sign in to comment.