Class CrowdEntityXmlMapper<T,I extends T>

All Implemented Interfaces:
BambooStAXMappingHelper<T,I>
Direct Known Subclasses:
AliasMapper, ApplicationMapper, DirectoryMapper, PartialCrowdEntityXmlMapper

public abstract class CrowdEntityXmlMapper<T,I extends T> extends BambooStAXMappingListHelperAbstractImpl<T,I>
A generic mapper that contains helper methods and attributes to map domain objects to database objects and vice-versa.
  • Field Details

  • Constructor Details

    • CrowdEntityXmlMapper

      public CrowdEntityXmlMapper(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.support.TransactionOperations ops)
  • Method Details

    • exportProperties

      protected void exportProperties(@NotNull @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull T entity, @NotNull @NotNull org.hibernate.Session session, ExportDetailsBean exportDetailsBean) throws Exception
      Exports an internal entity to an XML element.

      This exports: id, name, createdDate, updatedDate and active.

      Overrides:
      exportProperties in class BambooStAXMappingHelperAbstractImpl<T,I extends T>
      Parameters:
      outputElement - XML element to export to.
      entity - entity to export.
      session - Hibernate session object
      Throws:
      Exception - when something went wrong
    • importProperties

      protected void importProperties(@NotNull I object, @NotNull @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull @NotNull org.hibernate.Session session) throws Exception
      Description copied from class: BambooStAXMappingHelperAbstractImpl
      Import properties to the object. Due to nature of XML parsing this method is called for each child node in the node that was passed to importXml method
      Overrides:
      importProperties in class BambooStAXMappingHelperAbstractImpl<T,I extends T>
      Parameters:
      object - object being imported
      inputCursor - input cursor pointing to the child node of node that was passed to importXml method
      session - Hibernate session object
      Throws:
      Exception - when something went wrong
    • exportSingleValuedAttributes

      protected void exportSingleValuedAttributes(com.atlassian.crowd.embedded.api.Attributes entity, org.codehaus.staxmate.out.SMOutputElement element, ExportDetailsBean exportDetailsBean) throws Exception
      Exports Map<String, String> to an XML element.

      Only use this for entities with simple attributes (Directory, Application) and not complex attributes (User, Group).

      Parameters:
      entity - entity with single valued attributes.
      element - XML element to export to.
      Throws:
      Exception