HHH-9369 Fix @Formula of enum type results in ClassCastException

(cherry picked from commit fff49977ab990d65764704fd6617b775ca2032c3)
HHH-9369 Fix @Formula of enum type results in ClassCastException (minor fix for 4.2)