Interface DocStoreBeanAdapter<T>

    • Method Detail

      • registerPaths

        void registerPaths()
        In deployment phase read the embedded/nested document information.
      • applyPath

        void applyPath​(Query<T> query)
        Apply the document structure to the query so that it fetches the required properties to build the document (typically in JSON form).
        Specified by:
        applyPath in interface BeanDocType<T>
      • isMapped

        boolean isMapped()
        Return true if this type is mapped for doc storage.
      • getQueueId

        String getQueueId()
        Return the unique queueId for this bean type. This is expected to be a relatively short unique string (rather than a fully qualified class name).
      • getMode

        io.ebean.annotation.DocStoreMode getMode​(io.ebeaninternal.server.core.PersistRequest.Type persistType,
                                                 io.ebean.annotation.DocStoreMode txnMode)
        Determine and return how this persist type will be processed given the transaction mode.

        Some transactions (like bulk updates) might specifically turn off indexing for example.

      • updateEmbedded

        void updateEmbedded​(io.ebeaninternal.server.core.PersistRequestBean<T> request,
                            DocStoreUpdates docStoreUpdates)
        Process the persist request adding any embedded/nested document invalidation to the docStoreUpdates.

        This is expected to check the specific properties to see what other documents they are nested in and register invalidation events based on that.

        Parameters:
        request - The persist request
        docStoreUpdates - Invalidation events are registered to this docStoreUpdates
      • updateEmbedded

        void updateEmbedded​(Object idValue,
                            String embeddedProperty,
                            String embeddedRawContent,
                            DocUpdateContext txn)
                     throws IOException
        Process an update of an embedded document.
        Specified by:
        updateEmbedded in interface BeanDocType<T>
        Parameters:
        idValue - the id of the bean effected by an embedded document update
        embeddedProperty - the path of the property
        embeddedRawContent - the embedded content for this property in JSON form
        txn - the doc store transaction to use to process the update
        Throws:
        IOException
      • rawProperty

        String rawProperty​(String property)
        Return an un-analysed property to use instead of the given property.

        For analysed properties that we want to sort on we will map the property to an additional 'raw' property that we can use for sorting etc.

        Specified by:
        rawProperty in interface BeanDocType<T>
      • hasEmbeddedInvalidation

        boolean hasEmbeddedInvalidation()
        Return true if this bean type as embedded invalidate registered.