Also I wonder if the problem really isn't simply a conceptual mismatch problem. You are asking Hibernate to treat the enum at the JDBC-level as a String (@Enumerated(STRING)). But in the database it isn't a String; its a UDT.
I am going to push even this documentation task to the next bugfix release because I still don't feel certain what all to say/cover. I think we could maybe have a separate section in the Basic Types mapping chapter discussing mapping enums to PGSQL enums covering:
-
Standard JPA mappings using @Enumerated(STRING) as outlined by Christopher Smith - although I'd still like to understand if the NG driver handles this better.
-
Mapping directly to the UDT via an AttributeConverter or custom Type
I need input here folks. Hard for me as a non-pgsql user/guru to figure this out.
|