com.vladmihalcea.hibernate.type.basic
Class PostgreSQLEnumType

java.lang.Object
  extended by org.hibernate.type.EnumType
      extended by com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType
All Implemented Interfaces:
Serializable, org.hibernate.usertype.DynamicParameterizedType, org.hibernate.usertype.EnhancedUserType, org.hibernate.usertype.LoggableUserType, org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType

public class PostgreSQLEnumType
extends org.hibernate.type.EnumType

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:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.hibernate.type.EnumType
org.hibernate.type.EnumType.EnumValueMapperSupport
 
Nested classes/interfaces inherited from interface org.hibernate.usertype.DynamicParameterizedType
org.hibernate.usertype.DynamicParameterizedType.ParameterType
 
Field Summary
static PostgreSQLEnumType INSTANCE
           
 
Fields inherited from class org.hibernate.type.EnumType
ENUM, NAMED, TYPE
 
Fields inherited from interface org.hibernate.usertype.DynamicParameterizedType
ACCESS_TYPE, ENTITY, IS_DYNAMIC, IS_PRIMARY_KEY, PARAMETER_TYPE, PROPERTY, RETURNED_CLASS, XPROPERTY
 
Constructor Summary
PostgreSQLEnumType()
          Initialization constructor taking the default Configuration object.
PostgreSQLEnumType(Configuration configuration)
          Initialization constructor taking the Class and Configuration objects.
 
Method Summary
 void nullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SessionImplementor session)
           
 
Methods inherited from class org.hibernate.type.EnumType
assemble, deepCopy, disassemble, equals, fromXMLString, hashCode, isMutable, isOrdinal, nullSafeGet, objectToSQLString, replace, returnedClass, setParameterValues, sqlTypes, toLoggableString, toXMLString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final PostgreSQLEnumType INSTANCE
Constructor Detail

PostgreSQLEnumType

public PostgreSQLEnumType()
Initialization constructor taking the default Configuration object.


PostgreSQLEnumType

public PostgreSQLEnumType(Configuration configuration)
Initialization constructor taking the Class and Configuration objects.

Parameters:
configuration - custom Configuration object.
Method Detail

nullSafeSet

public void nullSafeSet(PreparedStatement st,
                        Object value,
                        int index,
                        org.hibernate.engine.spi.SessionImplementor session)
                 throws org.hibernate.HibernateException,
                        SQLException
Specified by:
nullSafeSet in interface org.hibernate.usertype.UserType
Overrides:
nullSafeSet in class org.hibernate.type.EnumType
Throws:
org.hibernate.HibernateException
SQLException


Copyright © 2022. All rights reserved.