Class EnumStringType

java.lang.Object
org.hibernate.type.EnumType
com.atlassian.bamboo.hibernate.type.EnumStringType
All Implemented Interfaces:
Serializable, org.hibernate.type.spi.TypeConfigurationAware, org.hibernate.usertype.DynamicParameterizedType, org.hibernate.usertype.EnhancedUserType, org.hibernate.usertype.LoggableUserType, org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType

@Deprecated public class EnumStringType extends org.hibernate.type.EnumType
Deprecated.
since 6.5 use @Enumerated(EnumType.STRING) instead
Specialization of Hibernate's EnumType that always stores value in string format thus allowing us to avoid cumbersome part of configuration. So instead of

 <property name="propertyName" column="COLUMN_NAME">
     <type name="org.hibernate.type.EnumType">
         <param name="enumClass">com.atlassian.bamboo.enum.class.name</param>
         <param name="type">12</param> <!-- Types.VARCHAR == 12 -->
     </type>
 </property>
 
we now have

 <property name="propertyName" column="COLUMN_NAME">
     <type name="com.atlassian.bamboo.hibernate.type.EnumStringType">
         <param name="enumClass">com.atlassian.bamboo.enum.class.name</param>
     </type>
 </property>
 
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.hibernate.usertype.DynamicParameterizedType

    org.hibernate.usertype.DynamicParameterizedType.ParameterType
  • Field Summary

    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

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Original EnumType.fromXMLString(String) tries to do numeric conversion first and then only in case of failure it does what we need.
    void
    Deprecated.
     

    Methods inherited from class org.hibernate.type.EnumType

    assemble, deepCopy, disassemble, equals, getTypeConfiguration, hashCode, isMutable, isOrdinal, nullSafeGet, nullSafeSet, objectToSQLString, replace, returnedClass, setTypeConfiguration, sqlTypes, toLoggableString, toXMLString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EnumStringType

      public EnumStringType()
      Deprecated.
  • Method Details

    • setParameterValues

      public void setParameterValues(Properties parameters)
      Deprecated.
      Specified by:
      setParameterValues in interface org.hibernate.usertype.ParameterizedType
      Overrides:
      setParameterValues in class org.hibernate.type.EnumType
    • fromXMLString

      public Object fromXMLString(String xmlValue)
      Deprecated.
      Original EnumType.fromXMLString(String) tries to do numeric conversion first and then only in case of failure it does what we need.
      Specified by:
      fromXMLString in interface org.hibernate.usertype.EnhancedUserType
      Overrides:
      fromXMLString in class org.hibernate.type.EnumType