Class BambooStAXMappingListHelperAbstractImpl<T,​I extends T>

    • Constructor Detail

      • BambooStAXMappingListHelperAbstractImpl

        protected BambooStAXMappingListHelperAbstractImpl​(org.hibernate.SessionFactory sessionFactory,
                                                          BambooStAXListImportStrategy listImportStrategy,
                                                          org.springframework.transaction.support.TransactionOperations transactionOperations)
      • BambooStAXMappingListHelperAbstractImpl

        protected BambooStAXMappingListHelperAbstractImpl​(org.hibernate.SessionFactory sessionFactory,
                                                          org.springframework.transaction.support.TransactionOperations transactionOperations)
    • Method Detail

      • getXmlElementNodeName

        @NotNull
        public @NotNull String getXmlElementNodeName()
      • beforeImportListItem

        public void beforeImportListItem​(@NotNull
                                         @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor,
                                         @NotNull
                                         @NotNull List<I> list,
                                         @NotNull
                                         @NotNull org.hibernate.Session session)
                                  throws Exception
        Called when parser reaches the list's element node.
        Parameters:
        inputCursor - inputCursor pointing to the list's element opening node
        list - list of elements being imported
        session - Hibernate session object
        Throws:
        Exception - when something went wrong
      • afterImportListItem

        public void afterImportListItem​(@NotNull
                                        @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor,
                                        @NotNull
                                        @NotNull List<I> list,
                                        @NotNull
                                        I object,
                                        long objectIndex,
                                        @NotNull
                                        @NotNull org.hibernate.Session session)
                                 throws Exception
        Called after parser completes parsing all child nodes in list's element node.
        Parameters:
        inputCursor - cursor pointing to the list's element opening node
        list - list of elements being imported
        object - object that has been imported
        objectIndex - one-based index of the object being parsed
        session - Hibernate session object
        Throws:
        Exception - when something went wrong
      • createListRootElement

        @NotNull
        protected @NotNull org.codehaus.staxmate.out.SMOutputElement createListRootElement​(@NotNull
                                                                                           @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement)
                                                                                    throws XMLStreamException
        Creates list root node
        Parameters:
        outputElement - parent node for list root node
        Returns:
        list root node
        Throws:
        XMLStreamException - when something went wrong
      • exportListXml

        public final <E extends T> void exportListXml​(@NotNull
                                                      @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement,
                                                      @NotNull
                                                      @NotNull Iterable<E> iterable,
                                                      ExportDetailsBean exportDetailsBean)
                                               throws Exception
        Exports a collection to the XML.
        Parameters:
        outputElement - parent node for collection root node
        iterable - collection to be exported
        exportDetailsBean -
        Throws:
        Exception - when something went wrong
      • exportListXml

        public <E extends T> void exportListXml​(@NotNull
                                                @NotNull org.hibernate.Session session,
                                                @NotNull
                                                @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement,
                                                @NotNull
                                                @NotNull Iterable<E> iterable,
                                                ExportDetailsBean exportDetailsBean)
                                         throws Exception
        Exports a collection to the XML. If collection is empty collection root not will not be created.
        Parameters:
        session - Hibernate session object
        outputElement - parent node for collection root node
        iterable - collection to be exported
        exportDetailsBean -
        Throws:
        Exception - when something went wrong
      • importListXml

        @NotNull
        public final @NotNull List<I> importListXml​(@NotNull
                                                    @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor)
                                             throws Exception
        Import list from XML
        Parameters:
        inputCursor - parent node for list root node
        Returns:
        list of the imported elements
        Throws:
        Exception - when something went wrong
      • importListXml

        @NotNull
        public @NotNull List<I> importListXml​(@NotNull
                                              @NotNull org.hibernate.Session session,
                                              @NotNull
                                              @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor)
                                       throws Exception
        Import list from XML
        Parameters:
        session - Hibernate session object
        inputCursor - parent node for list root node
        Returns:
        list of the imported elements
        Throws:
        Exception - when something went wrong
      • importListXmlInTransaction

        protected void importListXmlInTransaction​(org.codehaus.staxmate.in.SMInputCursor inputCursor)
      • eventEndElementOfListItemSaveObject

        protected void eventEndElementOfListItemSaveObject​(@NotNull
                                                           @NotNull org.hibernate.Session session,
                                                           @NotNull
                                                           T object,
                                                           long objectIndex,
                                                           long flushSize)
                                                    throws org.hibernate.HibernateException
        Parameters:
        session - Hibernate session object
        object - object to be saved
        objectIndex - one-based index of the object in the list of object being read
        flushSize - number of objects to be saved before session.flush() is executed
        Throws:
        SQLException - when something went wrong
        org.hibernate.HibernateException - when something went wrong
      • flushIfNeeded

        protected void flushIfNeeded​(org.hibernate.Session session,
                                     long objectIndex,
                                     long flushSize)
                              throws org.hibernate.HibernateException
        Throws:
        org.hibernate.HibernateException