Class 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:
    Serialized Form
    • 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
      EnumStringType()
      Deprecated.
       
    • Constructor Detail

      • EnumStringType

        public EnumStringType()
        Deprecated.
    • Method Detail

      • 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