Buggy code:
@ SuppressWarnings ( "unchecked" ) public class EnumType implements Serializable , DynamicParameterizedType , EnhancedUserType , LoggableUserType { private static final Logger LOG = CoreLogging . logger ( EnumType . class ) ; public static final String ENUM = "enumClass" ; public static final String NAMED = "useNamed" ; public static final String TYPE = "type" ; private Class < ? extends Enum > enumClass ; private EnumType . EnumValueMapper enumValueMapper ; private int sqlType ; @ Override public void setParameterValues ( Properties parameters ) { } private javax . persistence . EnumType getEnumType ( ParameterType reader ) { } private < T extends Annotation > T getAnnotation ( Annotation [ ] annotations , Class < T > anClass ) { } private EnumType . EnumValueMapper interpretParameters ( Properties parameters ) { if ( parameters . containsKey ( EnumType . NAMED ) ) { final boolean useNamed = ConfigurationHelper . getBoolean ( EnumType . NAMED , parameters ) ; if ( useNamed ) { return new EnumType . NamedEnumValueMapper ( ) ; } else { return new EnumType . OrdinalEnumValueMapper ( ) ; } } if ( parameters . containsKey ( EnumType . TYPE ) ) { final int type = Integer . decode ( ( ( String ) ( parameters . get ( EnumType . TYPE ) ) ) ) ; if ( isNumericType ( type ) ) { return new EnumType . OrdinalEnumValueMapper ( ) ; } else if ( isCharacterType ( type ) ) { <START_BUG> return new EnumType . OrdinalEnumValueMapper ( ) ; <END_BUG> } else { throw new HibernateException ( String . format ( Locale . ENGLISH , "Passed<seq2seq4repair_space>JDBC<seq2seq4repair_space>type<seq2seq4repair_space>code<seq2seq4repair_space>[%s]<seq2seq4repair_space>not<seq2seq4repair_space>recognized<seq2seq4repair_space>as<seq2seq4repair_space>numeric<seq2seq4repair_space>nor<seq2seq4repair_space>character" , type ) ) ; } } return new EnumType . OrdinalEnumValueMapper ( ) ; } private boolean isCharacterType ( int jdbcTypeCode ) { } private boolean isNumericType ( int jdbcTypeCode ) { } @ Override public int [ ] sqlTypes ( ) { } @ Override public Class < ? extends Enum > returnedClass ( ) { } @ Override public boolean equals ( Object x , Object y ) throws HibernateException { } @ Override public int hashCode ( Object x ) throws HibernateException { } @ Override public Object nullSafeGet ( ResultSet rs , String [ ] names , SessionImplementor session , Object owner ) throws SQLException { } @ Override public void nullSafeSet ( PreparedStatement st , Object value , int index , SessionImplementor session ) throws SQLException , HibernateException { } @ Override public Object deepCopy ( Object value ) throws HibernateException { } @ Override public boolean isMutable ( ) { } @ Override public Serializable disassemble ( Object value ) throws HibernateException { } @ Override public Object assemble ( Serializable cached , Object owner ) throws HibernateException { } @ Override public Object replace ( Object original , Object target , Object owner ) throws HibernateException { } @ Override public String objectToSQLString ( Object value ) { } @ Override public String toXMLString ( Object value ) { } @ Override public Object fromXMLString ( String xmlValue ) { } @ Override public String toLoggableString ( Object value , SessionFactoryImplementor factory ) { } public boolean isOrdinal ( ) { } private interface EnumValueMapper extends Serializable { int getSqlType ( ) { } Enum getValue ( ResultSet rs , String [ ] names ) throws SQLException { } void setValue ( PreparedStatement st , Enum value , int index ) throws SQLException { } String objectToSQLString ( Enum value ) { } String toXMLString ( Enum value ) { } Enum fromXMLString ( String xml ) { } } public abstract class EnumValueMapperSupport implements EnumType . EnumValueMapper { protected abstract Object extractJdbcValue ( Enum value ) { } @ Override public void setValue ( PreparedStatement st , Enum value , int index ) throws SQLException { } } private class OrdinalEnumValueMapper extends EnumType . EnumValueMapperSupport implements Serializable , EnumType . EnumValueMapper { private transient Enum [ ] enumsByOrdinal ; @ Override public int getSqlType ( ) { } @ Override public Enum getValue ( ResultSet rs , String [ ] names ) throws SQLException { } private Enum fromOrdinal ( int ordinal ) { } private Enum [ ] enumsByOrdinal ( ) { } @ Override public String objectToSQLString ( Enum value ) { } @ Override public String toXMLString ( Enum value ) { } @ Override public Enum fromXMLString ( String xml ) { } @ Override protected Object extractJdbcValue ( Enum value ) { } } private class NamedEnumValueMapper extends EnumType . EnumValueMapperSupport implements Serializable , EnumType . EnumValueMapper { @ Override public int getSqlType ( ) { } @ Override public Enum getValue ( ResultSet rs , String [ ] names ) throws SQLException { } private Enum fromName ( String name ) { } @ Override public String objectToSQLString ( Enum value ) { } @ Override public String toXMLString ( Enum value ) { } @ Override public Enum fromXMLString ( String xml ) { } @ Override protected Object extractJdbcValue ( Enum value ) { } } }

Fix:
return new EnumType . NamedEnumValueMapper ( ) ;