Class JPAStorageRecord<T>

Type Parameters:
T - type of object

@Entity public class JPAStorageRecord<T> extends MutableStorageRecord<T>
Implementation of MutableStorageRecord annotated for JPA.
  • Field Details

    • CONTEXT_SIZE

      public static final int CONTEXT_SIZE
      Length of the context column.
      See Also:
    • KEY_SIZE

      public static final int KEY_SIZE
      Length of the key column.
      See Also:
    • context

      private String context
      Context string.
    • key

      private String key
      Key string.
  • Constructor Details

    • JPAStorageRecord

      public JPAStorageRecord()
      Creates a new JPA storage record. All properties initialized to null.
  • Method Details

    • getContext

      @Nonnull public String getContext()
      Returns the context.
      Returns:
      context
    • setContext

      public void setContext(@Nonnull @NotEmpty String ctx)
      Sets the context.
      Parameters:
      ctx - to set
    • getKey

      @Nonnull public String getKey()
      Returns the key.
      Returns:
      key
    • setKey

      public void setKey(@Nonnull @NotEmpty String k)
      Sets the key.
      Parameters:
      k - to set
    • getValue

      @Nonnull public String getValue()
      Get the record value.
      Overrides:
      getValue in class StorageRecord<T>
      Returns:
      the record value
    • getExpiration

      @Nullable public Long getExpiration()
      Get the record expiration.
      Overrides:
      getExpiration in class StorageRecord<T>
      Returns:
      the record expiration, or null if none
    • getVersion

      public long getVersion()
      Get the record version.
      Overrides:
      getVersion in class StorageRecord<T>
      Returns:
      the record version
    • resetVersion

      public void resetVersion()
      Resets the version of this storage record to 1.
    • toString

      public String toString()
      Overrides:
      toString in class Object