Class UpdateAutoTimestampEntity

java.lang.Object
google.registry.model.ImmutableObject
google.registry.model.UpdateAutoTimestampEntity
All Implemented Interfaces:
UnsafeSerializable, Serializable, Cloneable
Direct Known Subclasses:
AllocationToken, Cursor, EppResource, RdeRevision, RegistrarBase, RegistryLock, UserBase

@MappedSuperclass public abstract class UpdateAutoTimestampEntity extends ImmutableObject implements UnsafeSerializable
Base class for entities that contains an UpdateAutoTimestamp which is updated every time the entity is persisted.
See Also:
  • Constructor Details

    • UpdateAutoTimestampEntity

      public UpdateAutoTimestampEntity()
  • Method Details

    • getUpdateTimestamp

      public UpdateAutoTimestamp getUpdateTimestamp()
      Get the UpdateAutoTimestamp for this entity.
    • copyUpdateTimestamp

      protected void copyUpdateTimestamp(UpdateAutoTimestampEntity other)
      Copies updateTimestamp from another entity.

      This method is for the few cases when updateTimestamp is copied between different types of entities. Use ImmutableObject.clone(T) for same-type copying.

    • resetUpdateTimestamp

      protected void resetUpdateTimestamp()
      Resets the updateTimestamp to force Hibernate to persist it.

      This method is for use in setters in derived builders that do not result in the derived object being persisted.

    • setUpdateTimestamp

      protected void setUpdateTimestamp(UpdateAutoTimestamp timestamp)
      Sets the updateTimestamp.

      This method is for use in the few places where we need to restore the update timestamp after mutating a collection in order to force the new timestamp to be persisted when it ordinarily wouldn't.