[jira] Created: (CAY-994) Add extended enumeration support

From: Michael Gentry (JIRA) ("Michael)
Date: Sun Mar 02 2008 - 09:48:16 EST

  • Next message: Michael Gentry: "Re: Extended Enumerations"

    Add extended enumeration support
    --------------------------------

                     Key: CAY-994
                     URL: https://issues.apache.org/cayenne/browse/CAY-994
                 Project: Cayenne
              Issue Type: New Feature
              Components: Cayenne Core Library, Cayenne Documentation, Cayenne Examples, Cayenne Website
        Affects Versions: 3.0
             Environment: All
                Reporter: Michael Gentry
                Assignee: Michael Gentry
                 Fix For: 3.0

    Current Cayenne support for Java 1.5 enumerations is relatively simplistic. Given:

    enum Color { RED, GREEN, BLUE }

    Cayenne will store 0, 1, and 2 (respectively) for a numeric column, or "RED", "GREEN", and "BLUE" for a string column. There is no way to specify your own values for the enumerations, which is especially important when mapping to an existing schema. Also, in the case of numeric types, the order they are declared is fragile. If someone later sorts the colors to be BLUE, GREEN, RED, then the values of BLUE and RED will be swapped (and incorrect) on future reads from the database.

    Cayenne needs to be able to support explicitly mapping the enumeration to the database value.

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Sun Mar 02 2008 - 09:49:25 EST