XML Enum mapping with parameter 'type'

Description

Hello,
I was migrating from hibernate-core 4.3.11 to 5.1.0

I had this Hibernate XML mapping:

After I started jetty, hibernate started to validate my schema and throws an exception:

I was curious why it was expecting SQLType 4 (Integer) instead of SQLType 12 (Varchar). On version 4.3.11 it works perfect.

I checked out hibernate-core 5.1.0 sources and found source of problem:

My mapping passed here with 2 parameters (enumClass and type).
Code handled it correct, it found that parameters contains 'type', but the problem is
that after both if statements it returns OrdinalEnumValueMapper.
Which is for if statement: isCharacterType( type ) incorrect. Should be NamedEnumValueMapper, (look at containsKey( NAMED ) handler, it works good).

Environment

PostgreSQL 9.3.13
Linux Mint 17.3
OpenJDK 1.8.0_92

Assignee

Vlad Mihalcea

Reporter

Vova Perebykivskyi

Fix versions

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure