Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-12558

Fix CMIS Query on multi-valued property with JOIN

    XMLWordPrintable

    Details

    • Tags:
    • Backlog priority:
      300

      Description

      The test below fails against PostgreSQL with exception:

      org.postgresql.util.PSQLException: ERROR: relation "_B_dc_subjects" does not exist
      Position: 1308

      This failure is caused by the "B" prefix being incorrectly added to table dc_subjects in the generated SQL clause:

      EXISTS (SELECT 1 FROM "_B_dc_subjects" WHERE "_B_hierarchy"."id" = "_B_dc_subjects"."id" AND "_B_dc_subjects"."item" NOT IN )

      TestNuxeoBinding.java
      @Test
      public void testQueryJoinWithMultipleTypesAndMultiValuedProperty() throws Exception {
          String statement = "SELECT A.cmis:objectId, A.cmis:name, B.dc:subjects, C.note" //
                  + " FROM cmis:document A" //
                  + " LEFT JOIN File B ON A.cmis:objectId = B.cmis:objectId" //
                  + " LEFT JOIN Note C ON A.cmis:objectId = C.cmis:objectId" //
                  + " WHERE ANY A.nuxeo:secondaryObjectTypeIds NOT IN ('Foo')" //
                  + "   AND (A.cmis:objectTypeId NOT IN ('File')" //
                  + "     OR ANY B.dc:subjects NOT IN ('foo'))";
          ObjectList res = query(statement);
          assertEquals(3, res.getNumItems().intValue());
      }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: