Class Document

java.lang.Object
org.imixs.workflow.engine.jpa.Document
All Implemented Interfaces:
Serializable

@Entity public class Document extends Object implements Serializable
This Document entity bean is a wrapper class for the org.imixs.workflow.ItemCollection which is used in all Imixs-Workflow Interfaces. The Document is used by the DocumentService to store ItemCollections into a database, using the Java Persistence API. Each Document is added into the Lucene index.

A Document contains a universal unique ID to identify the Entity. Also the Document contains the following additional properties

  • type
  • created
  • modified

The creation time represents the point of time where the Document object was created. The modify property represents the point of time when the Document was last modified by the DocumentService. The type property is used to categorize documents in a database. If an ItemCollection contains the attribute 'type' the value will be automatically mapped to the type property.

The data attribute is used to hold the ItemCollection data. It is mapped by a OR-Mapper to a large object (Lob).

A Client should not work directly with an instance of the Document entity. It's recommended to use the DocumentService which acts as a session facade to manage instances of ItemCollection persisted in a database system.

Version:
1.0
Author:
rsoika
See Also:
  • Constructor Details

    • Document

      public Document()
      A Document will be automatically initialized with a unique id and a creation date.
    • Document

      public Document(String aID)
      This constructor allows the creation of an Document Instance with a default uniqueID
      Parameters:
      aID -
  • Method Details

    • isPending

      public boolean isPending()
      This transient flag indicates if the document was just saved and is still managed by the entityManager. In this case the entity may not be detached by other methods during the same transaction. See issue #230.
      Returns:
      save status
    • setPending

      public void setPending(boolean pandingState)
    • getId

      public String getId()
      returns the unique identifier for the Entity.
      Returns:
      universal id
    • setId

      protected void setId(String aID)
    • getVersion

      public Integer getVersion()
    • setVersion

      public void setVersion(Integer version)
    • getType

      public String getType()
      returns the type property of the entity instance. This property can be provided by an itemColleciton in the attribute 'type'. Values will be case sensitive!
      Returns:
      See Also:
      • org.imixs.workflow.jee.ejb.EntityService
    • setType

      public void setType(String type)
    • getCreated

      public Calendar getCreated()
      returns the creation point of time.
      Returns:
      time of creation
    • setCreated

      public void setCreated(Calendar created)
    • getModified

      public Calendar getModified()
      Returns the time of last modification. This attribute is synchronized by the DocumetnService with the item '$modified'.
      Returns:
      time of modification
      See Also:
      • setData()
    • setModified

      public void setModified(Calendar modified)
      Set the time of last modification. This attribute is automatically synchronized with the item '$modified'.
    • getData

      public Map<String,List<Object>> getData()
      returns the data object part of the Entity represented by a java.util.Map

      Data is loaded eager because it is read in any case by the DocumentService.

      Returns:
      Map
    • setData

      public void setData(Map<String,List<Object>> itemCol)
      sets a data object for this Entity.

      Note: the modified timestamp will be updated automatically to the current point of time (see setModified) independent from the value of the item $modified. The item $modified will be updated by the DocumentService on read.

      Parameters:
      data -
      Throws:
      InvalidAccessException - if $modified is missing