Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-532

Criterion get does not select id (only jsonb)

    XMLWordPrintable

Details

    • CP: sprint 78
    • 1
    • Core: Platform

    Description

      This bug was introduced with RMB-497 work.

      For example, functions like this is affected:

      public <T> void get(String table, Class<T> clazz, Criterion filter, boolean returnCount,
            Handler<AsyncResult<Results<T>>> replyHandler)
      
        Criterion c = new Criterion(
            new Criteria().addField("id").setJSONB(false).setOperation("=").setVal(entryId));
        PostgresClient.getInstance(context.owner(), tenantId).get(CONFIG_TABLE, Config.class, c, false,   reply -> 
      

      With RMB 29.1.0:

      SELECT jsonb FROM harvard_mod_configuration.config_data WHERE id = '0dc6c4d7-b5be-4013-b2b5-222de7f59429'
      

      Here id is not selected.

      With RMB 28:

      SELECT jsonb,id FROM harvard_mod_configuration.config_data  WHERE id = 'e287ca98-c624-475f-8bb6-ace0e6e85e3d'
      

      The missing id causes this:

      java.lang.NullPointerException
              at org.folio.rest.persist.PostgresClient.deserializeRow(PostgresClient.java:2454)
              at org.folio.rest.persist.PostgresClient.deserializeResults(PostgresClient.java:2395)
              at org.folio.rest.persist.PostgresClient.processResults(PostgresClient.java:2363)
              at org.folio.rest.persist.PostgresClient.lambda$35(PostgresClient.java:1592)
              at org.folio.rest.persist.PostgresClient.lambda$43(PostgresClient.java:1884)
              at org.folio.rest.persist.PostgresClient.lambda$57(PostgresClient.java:2596)
      

      https://github.com/folio-org/raml-module-builder/blob/v29.1.0/domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java#L2454
      Setting the id in the jsonb is no longer needed because the database trigger always does this.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                adam Adam Dickmeiss
                adam Adam Dickmeiss
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases