[hibernate-issues] [Hibernate-JIRA] Created: (ANN-717) org.hibernate.type.EnumType throws exceptions when trying to map unknown values to an Enum

Alvin (JIRA) noreply at atlassian.com
Tue Mar 25 00:50:33 EDT 2008


org.hibernate.type.EnumType throws exceptions when trying to map unknown values to an Enum
------------------------------------------------------------------------------------------

                 Key: ANN-717
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-717
             Project: Hibernate Annotations
          Issue Type: Bug
    Affects Versions: 3.3.1.GA
         Environment: All version
            Reporter: Alvin


When EnumType encounters a value in the database which is not mapped to a specific enum the class throws an exception. I know this is how it was made to work but it may be better instead to do a graceful error - i.e. return null instead of throwing an exception.

This case arises from the following scenario -

We are doing staged releases to our production environment and at points we will have two different versions of our code running.  If we add new Enum values into a version - the old version has problems running because it starts getting exceptions with unknown values when it is trying to map these enums.

I have discussed this briefly in the hibernate forum with not too many replies - http://forum.hibernate.org/viewtopic.php?t=984976 .


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list