Package org.bedework.calfacade.base
Class BwDbentity<T>
java.lang.Object
org.bedework.calfacade.base.DumpEntity<T>
org.bedework.calfacade.base.BwUnversionedDbentity<T>
org.bedework.calfacade.base.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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bedework.calfacade.base.DumpEntity
DumpEntity.DumpType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeletedEntity(BwDbentity<?> val) Add a deleted entity - these may appear as a result of updates.voidCalled after delete from the dbvoidCalled when we are about to delete from the dbvoidCalled when we are about to save the object.voidCalled when we are about to update the object.intCollection<BwDbentity<?>>intgetSeq()Get the entity seqintlength()Size to use for quotas.voidsetByteSize(int val) The last calculated byte size should be stored with the entity.voidsetSeq(int val) Set the seq for this entityMethods inherited from class org.bedework.calfacade.base.BwUnversionedDbentity
clone, compareTo, equals, getHref, getId, hashCode, markUnsaved, setHref, setId, toStringSegment, unsavedMethods inherited from class org.bedework.calfacade.base.DumpEntity
dump, dump, getLogger, hasDumpValueMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
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
Add a deleted entity - these may appear as a result of updates. A null parameter is a noop.- Parameters:
val-
-
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
-