Class ListAsSQLArrayUserType.ENUM<E extends java.lang.Enum<E>>

  • All Implemented Interfaces:
    org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType
    Enclosing class:
    ListAsSQLArrayUserType<T>

    public static class ListAsSQLArrayUserType.ENUM<E extends java.lang.Enum<E>>
    extends ListAsSQLArrayUserType<E>
    Warning, this one is special. You have to define a class that extends ENUM_LIST<E> and that has a no arguments constructor. For example : class MyEnumsList extends ENUM_LIST<MyEnumType> { public MyEnumList(){ super( MyEnum.values() ); } } Then, define : hibernate.property type="com.myPackage.MyEnumsList" hibernate.column name="fieldName" sql-type="int[]"
    • Constructor Detail

      • ENUM

        protected ENUM​(E[] theEnumValues)
        Parameters:
        theEnumValues - The values of enum (by invoking .values()).
    • Method Detail

      • getDataAsArray

        protected java.sql.Array getDataAsArray​(java.sql.Connection conn,
                                                java.lang.Object value)
                                         throws java.sql.SQLException
        Specified by:
        getDataAsArray in class ListAsSQLArrayUserType<E extends java.lang.Enum<E>>
        Throws:
        java.sql.SQLException