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

Remove internal prefetch at the DocumentModel level

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.1
    • Component/s: Core
    • Impact type:
      API change
    • Upgrade notes:
      Hide

      A scalar list defined by a xs:complexType with just one element is now consistently represented as a List in Java, never an array.

      Show
      A scalar list defined by a xs:complexType with just one element is now consistently represented as a List in Java, never an array.
    • Sprint:
      nxcore 10.1.1
    • Story Points:
      2

      Description

      DocumentModel has a notion of prefetch but it's not useful, as actual prefetch is done at a lower level anyway, and the implementation has complexity that can be removed.

      There is a (small) side effect to this change. We have two ways of representing simple lists of scalars in Nuxeo: the recommended way, xs:simpleType, is represented as an array in Java (a subclass of Object[]). The alternative way is to use a xs:complexType with just one element, and this is represented as a List in Java. For this alternative way, previously if the field was configured as prefetched, the Java code was incorrectly normalizing it to an array instead of a List. As there is no more prefetch this doesn't happen anymore.

      Another side effect is that code that expected DocumentModel.getTitle() to work on a detached document without the dublincore schema will now fail. Such a document must be fully detached with DocumentModel.detach(true) or the dublincore referenced before the document is detached.

      Note that prefetch still exists at a low level in VCS.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h