Class VKeyConverter<T,C extends Serializable>

java.lang.Object
google.registry.persistence.converter.VKeyConverter<T,C>
All Implemented Interfaces:
javax.persistence.AttributeConverter<VKey<? extends T>,C>

public abstract class VKeyConverter<T,C extends Serializable> extends Object implements javax.persistence.AttributeConverter<VKey<? extends T>,C>
Converts VKey to/from a type that can be directly stored in the database.

Typically the converted type is String or Long.

  • Constructor Details

    • VKeyConverter

      public VKeyConverter()
  • Method Details

    • convertToDatabaseColumn

      @Nullable public C convertToDatabaseColumn(@Nullable VKey<? extends T> attribute)
      Specified by:
      convertToDatabaseColumn in interface javax.persistence.AttributeConverter<T,C extends Serializable>
    • convertToEntityAttribute

      @Nullable public VKey<? extends T> convertToEntityAttribute(@Nullable C dbData)
      Specified by:
      convertToEntityAttribute in interface javax.persistence.AttributeConverter<T,C extends Serializable>
    • getEntityClass

      protected abstract Class<T> getEntityClass()
      Returns the class of the entity that the VKey represents.
    • getKeyClass

      protected abstract Class<C> getKeyClass()
      Returns the class of the key that the VKey holds.