Class DbEntity<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    Serializable, Comparable<T>, org.bedework.util.logging.Logged, org.bedework.webdav.servlet.access.SharedEntity
    Direct Known Subclasses:
    DbNamedEntity

    public abstract class DbEntity<T>
    extends UnversionedDbentity<T>
    implements org.bedework.webdav.servlet.access.SharedEntity
    Base type for a database entity. We require an id and the subclasses must implement hashcode and compareTo.
    Version:
    1.0
    Author:
    Mike Douglass
    See Also:
    Serialized Form
    • Constructor Detail

      • DbEntity

        public DbEntity()
        No-arg constructor
    • Method Detail

      • setByteSize

        public void setByteSize​(int val)
        The last calculated byte size should be stored with the entity. On update call calculateByteSize to get a new value and use the difference to adjust the quota.
        Parameters:
        val -
      • getByteSize

        public int getByteSize()
        Returns:
        int last byte size
      • setSeq

        public void setSeq​(Integer val)
        Set the seq for this entity
        Parameters:
        val - int seq
      • getSeq

        public Integer getSeq()
        Get the entity seq
        Returns:
        int the entity seq
      • setOwnerHref

        public void setOwnerHref​(String val)
        Specified by:
        setOwnerHref in interface org.bedework.webdav.servlet.access.SharedEntity
        Parameters:
        val -
      • getOwnerHref

        public String getOwnerHref()
        Specified by:
        getOwnerHref in interface org.bedework.webdav.servlet.access.SharedEntity
        Returns:
        String
      • setCreatorHref

        public void setCreatorHref​(String val)
        Parameters:
        val -
      • getCreatorHref

        public String getCreatorHref()
        Returns:
        String
      • setAccess

        public void setAccess​(String val)
        Specified by:
        setAccess in interface org.bedework.webdav.servlet.access.SharedEntity
        Parameters:
        val -
      • getAccess

        public String getAccess()
        Specified by:
        getAccess in interface org.bedework.webdav.servlet.access.SharedEntity
        Returns:
        String
      • setParentPath

        public void setParentPath​(String val)
        Specified by:
        setParentPath in interface org.bedework.webdav.servlet.access.SharedEntity
        Parameters:
        val -
      • getParentPath

        public String getParentPath()
        Specified by:
        getParentPath in interface org.bedework.webdav.servlet.access.SharedEntity
        Returns:
        parentPath.
      • setCreated

        public void setCreated​(String val)
        Parameters:
        val -
      • getCreated

        public String getCreated()
        Returns:
        String created
      • addDeletedEntity

        public void addDeletedEntity​(DbEntity<?> val)
        Add a deleted entity - these may appear as a result of updates. A null parameter is a noop.
        Parameters:
        val -
      • getDeletedEntities

        public Collection<DbEntity<?>> getDeletedEntities()
        Returns:
        deleted entities or null
      • beforeDeletion

        public void beforeDeletion()
        Called when we are about to delete from the db
      • afterDeletion

        public void afterDeletion()
        Called after delete from the db
      • beforeUpdate

        public void beforeUpdate()
        Called when we are about to update the object.
      • beforeSave

        public void beforeSave()
        Called when we are about to save the object. Default to calling before update
      • length

        public int length()
        Size to use for quotas.
        Returns:
        int