Class PostgreSQLEnumType

All Implemented Interfaces:
Serializable, org.hibernate.type.Type, org.hibernate.usertype.DynamicParameterizedType, org.hibernate.usertype.EnhancedUserType<Enum>, org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType<Enum>

@Deprecated public class PostgreSQLEnumType extends ImmutableDynamicParameterizedType<Enum>
Deprecated.
Hibernate 6.3 includes support for PostgreSQL enums with the PostgreSQLEnumJdbcType
Maps an Enum to a PostgreSQL ENUM column type.

For more details about how to use it, check out this article on vladmihalcea.com.

Author:
Vlad Mihalcea
See Also:
  • Field Details

  • Constructor Details

    • PostgreSQLEnumType

      public PostgreSQLEnumType()
      Deprecated.
  • Method Details

    • setParameterValues

      public void setParameterValues(Properties parameters)
      Deprecated.
    • get

      protected Enum get(ResultSet rs, int position, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) throws SQLException
      Deprecated.
      Description copied from class: ImmutableType
      Get the column value from the JDBC ResultSet.
      Specified by:
      get in class ImmutableType<Enum>
      Parameters:
      rs - JDBC ResultSet
      position - database column position
      session - current Hibernate Session
      owner - current Hibernate SessionFactoryImplementor
      Returns:
      column value
      Throws:
      SQLException - in case of failure
    • set

      protected void set(PreparedStatement st, Enum value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws SQLException
      Deprecated.
      Description copied from class: ImmutableType
      Set the column value on the provided JDBC PreparedStatement.
      Specified by:
      set in class ImmutableType<Enum>
      Parameters:
      st - JDBC PreparedStatement
      value - database column value
      index - database column index
      session - current Hibernate Session
      Throws:
      SQLException - in case of failure
    • returnedClass

      public Class<Enum> returnedClass()
      Deprecated.
      Specified by:
      returnedClass in interface org.hibernate.usertype.UserType<Enum>
      Overrides:
      returnedClass in class ImmutableType<Enum>
    • getSqlType

      public int getSqlType()
      Deprecated.
    • fromStringValue

      public Enum fromStringValue(CharSequence charSequence) throws org.hibernate.HibernateException
      Deprecated.
      Throws:
      org.hibernate.HibernateException