Please fix this. It is impossible to work with Hibernate as provider for Jpa when using NamedQuery. This throws ClassCastException of converting String to Enum.