Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-6972

Applying _sortKeys to results returned by a queryFilter on a relationship returns zero results when using MySQL as a repository

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: OpenIDM 4.5.0
    • Fix Version/s: OpenIDM 5.0.0
    • Component/s: documentation
    • Labels:
    • Target Version/s:
    • Story Points:
      1
    • Sprint:
      OpenIDM Sprint 69, OpenIDM Sprint 69 Mezzo
    • Cases:
    • Support Ticket IDs:

      Description

      Re-production steps:

      • Add the 'company' entry below to the managed.json of Sample 1
              {
                  "name" : "company",
                  "schema" : {
                      "$schema" : "http://forgerock.org/json-schema#",
                      "type" : "object",
                      "title" : "Company",
                      "description" : "",
                      "icon" : "",
                      "properties" : {
                          "_id" : {
                              "description" : "Unique Key for user object. ",
                              "title" : "Company Key",
                              "viewable" : true,
                              "searchable" : false,
                              "userEditable" : false,
                              "policies" : [ ],
                              "returnByDefault" : false,
                              "minLength" : "",
                              "pattern" : "",
                              "type" : "string"
                          },
                          "name" : {
                              "description" : "The company’s name, for display purposes.",
                              "title" : "Name",
                              "viewable" : true,
                              "searchable" : true,
                              "userEditable" : false,
                              "policies" : [ ],
                              "returnByDefault" : false,
                              "minLength" : "",
                              "pattern" : "",
                              "type" : "string"
                          },
                          "users" : {
                              "description" : "The users under this company or business unit.",
                              "title" : "Users",
                              "viewable" : true,
                              "searchable" : false,
                              "userEditable" : false,
                              "policies" : [ ],
                              "returnByDefault" : true,
                              "minLength" : "",
                              "pattern" : "",
                              "type" : "array",
                              "items" : {
                                  "type" : "relationship",
                                  "reverseRelationship" : true,
                                  "reversePropertyName" : "company",
                                  "validate" : true,
                                  "properties" : {
                                      "_ref" : {
                                          "type" : "string"
                                      },
                                      "_refProperties" : {
                                          "type" : "object",
                                          "properties" : {
                                              "_id" : {
                                                  "type" : "string",
                                                  "label" : ""
                                              }
                                          }
                                      }
                                  },
                                  "resourceCollection" : [
                                      {
                                          "path" : "managed/user",
                                          "label" : "User",
                                          "query" : {
                                              "queryFilter" : "true",
                                              "fields" : [
                                                  "userName",
                                                  "givenName",
                                                  "sn"
                                              ],
                                              "sortKeys" : [
                                                  "userName",
                                                  "givenName",
                                                  "sn"
                                              ]
                                          }
                                      }
                                  ]
                              }
                          }
                      },
                      "required" : [
                          "name"
                      ],
                      "order" : [
                          "_id",
                          "name",
                          "users"
                      ]
                  },
                  "iconClass" : "icon-database",
                  "iconSrc" : "img/icon-managedobject.png",
                  "type" : "Managed Object"
              }
      
      • Set up Sample 1 to use MySQL as a repository and start OpenIDM
      • Run reconciliation from XML to OpenIDM to generate users
      • Create a new 'Company' object and add both users
      • Query the new 'Company' object to confirm users are added (both should be returned under the users attribute):
      http://localhost:8080/openidm/managed/company/company
      
      {
        "_id": "company",
        "_rev": "2",
        "name": "company",
        "users": [
          {
            "_ref": "managed/user/bjensen",
            "_refProperties": {
              "_id": "7c52ee53-b170-47bb-a00a-4f56b62d09d0",
              "_rev": "0"
            }
          },
          {
            "_ref": "managed/user/scarter",
            "_refProperties": {
              "_id": "d18c2799-936d-4cf2-81d4-cb2a2d8d2a09",
              "_rev": "0"
            }
          }
        ]
      }
      
      • Query the 'Company' object's 'Users' attribute to return both users:
      http://localhost:8080/openidm/managed/company/company/users?_queryFilter=true
      
      {
        "result": [
          {
            "_ref": "managed/user/bjensen",
            "_refProperties": {
              "_id": "7c52ee53-b170-47bb-a00a-4f56b62d09d0",
              "_rev": "0"
            }
          },
          {
            "_ref": "managed/user/scarter",
            "_refProperties": {
              "_id": "d18c2799-936d-4cf2-81d4-cb2a2d8d2a09",
              "_rev": "0"
            }
          }
        ],
        "resultCount": 2,
        "pagedResultsCookie": null,
        "totalPagedResultsPolicy": "NONE",
        "totalPagedResults": -1,
        "remainingPagedResults": -1
      }
      
      • Query the 'Users' attribute of the 'Company' object and apply a '_sortKeys' value (No objects will be returned):
      http://localhost:8080/openidm/managed/company/company/users?_queryFilter=true&_sortKeys=givenName
      
      {
        "result": [],
        "resultCount": 0,
        "pagedResultsCookie": null,
        "totalPagedResultsPolicy": "NONE",
        "totalPagedResults": -1,
        "remainingPagedResults": -1
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Mike2 Mike Jang
                Reporter:
                tom.wood Tom Wood
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: