@Override
        public E map(ResultSet rs, int columnNumber, StatementContext ctx) throws SQLException {
            String name = rs.getString(columnNumber);

            return name == null || name.isEmpty() // some vendors treat null and empty varchar as the same
                ? null
                : enumClass.cast(BY_NAME_CACHE.get(enumClass, ctx).get(name, ctx));
        }
Map database integer values to enum ordinal values.

@param <E> the enum type to map
@param type the enum type to map
@return an enum mapper that matches on {@link Enum#ordinal()}
core/src/main/java/org/jdbi/v3/core/mapper/EnumMapper.java