Class BwDbentity<T>

Type Parameters:
T -
All Implemented Interfaces:
Serializable, Comparable<T>, org.bedework.util.logging.Logged
Direct Known Subclasses:
BwAttachment, BwAttendee, BwAuthUser, BwDbentityWrapper, BwFreeBusyComponent, BwOwnedDbentity, BwPrincipal, BwProperty, BwResourceContent, BwStringBase, BwSystem, BwView, BwXproperty, ScheduleMessage

public abstract class BwDbentity<T> extends BwUnversionedDbentity<T>
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:
  • Constructor Details

    • BwDbentity

      public BwDbentity()
      No-arg constructor
  • Method Details

    • 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(int val)
      Set the seq for this entity
      Parameters:
      val - int seq
    • getSeq

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

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

      public Collection<BwDbentity<?>> 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