Class StringCollectionUserType<V,C extends Collection<V>>

java.lang.Object
google.registry.persistence.converter.StringCollectionUserType<V,C>
Type Parameters:
V - Type parameter for collection values.
C - Type parameter for collection.
All Implemented Interfaces:
org.hibernate.usertype.UserType<C>
Direct Known Subclasses:
AllocationTokenVkeyListUserType, CidrBlockListUserType, InetAddressSetUserType, PostalInfoChoiceListUserType

public abstract class StringCollectionUserType<V,C extends Collection<V>> extends Object implements org.hibernate.usertype.UserType<C>
Base Hibernate custom type for Collection of entities backed by a postgresql one-dimension text array.

Note that Hibernate 6 and later have builtin support for collections of primitive, Enum and String types. Use this class on collection of user-defined entities.

  • Constructor Details

    • StringCollectionUserType

      public StringCollectionUserType()
  • Method Details

    • getSqlType

      public int getSqlType()
      Specified by:
      getSqlType in interface org.hibernate.usertype.UserType<V>
    • equals

      public boolean equals(C one, C other)
      Specified by:
      equals in interface org.hibernate.usertype.UserType<V>
    • hashCode

      public int hashCode(C collection)
      Specified by:
      hashCode in interface org.hibernate.usertype.UserType<V>
    • nullSafeGet

      public C nullSafeGet(ResultSet resultSet, int i, org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws SQLException
      Specified by:
      nullSafeGet in interface org.hibernate.usertype.UserType<V>
      Throws:
      SQLException
    • nullSafeSet

      public void nullSafeSet(PreparedStatement preparedStatement, C collection, int i, org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor) throws SQLException
      Specified by:
      nullSafeSet in interface org.hibernate.usertype.UserType<V>
      Throws:
      SQLException
    • deepCopy

      public C deepCopy(C collection)
      Specified by:
      deepCopy in interface org.hibernate.usertype.UserType<V>
    • isMutable

      public boolean isMutable()
      Specified by:
      isMutable in interface org.hibernate.usertype.UserType<V>
    • disassemble

      public Serializable disassemble(C collection)
      Specified by:
      disassemble in interface org.hibernate.usertype.UserType<V>
    • assemble

      public C assemble(Serializable serializable, Object o)
      Specified by:
      assemble in interface org.hibernate.usertype.UserType<V>