I use a custom UserType to right-trim CHAR columns in a legacy DB2, which returns CHAR columns right space padded.
Now I would like map such a column to a Enum, which fails using @Enumerated (org.hibernate.type.EnumType) due to the fact that DB column values with right pad spaces do not match enum names.
I would like to request the a EnumType that allows to inject/delegate to a UserType.
(db column + UserType = java object toString()-able or Numeric) + EnumType = Enum
Of course one could always define a UserType doing triming + enum conversion but would be nice to make it pluggable
I added a workaround delegated EnumType that uses some dirty stuff to handle the described process, including reflection and implementing stubs for ResultSet + PreparedStatement (thats why the Class is so huge, the real logic is quite small)