]
Jürgen updated HHH-5475:
------------------------
Attachment: EnumType.java
allow for a usertype delegate for org.hibernate.type.EnumType
-------------------------------------------------------------
Key: HHH-5475
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5475
Project: Hibernate Core
Issue Type: New Feature
Components: annotations, core
Affects Versions: 3.3.1, 3.5.4
Reporter: Jürgen
Attachments: EnumType.java, EnumType.java
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)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: