Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0-beta
    • Fix Version/s: None
    • Component/s: competitive, jpa
    • Labels:
      None
    • Environment:
      All

      Description

      Enums work as primary keys in TopLink and EclipseLink. DataNucleus supports them, too:

      http://www.datanucleus.org/products/accessplatform/jpa/primary_key.html

      It would be good to also include this in the specification because, not to support type safety in primary keys is fairly sad.

      Enum is a basic language feature, and most applications would enjoy significant benefits by mapping the keys of those little system behavior controlling lookup tables to enums.

      Consider a payment_type table. One can only generate the IDs of the table and use them for switching safely when the ids are mapped to enums. Any such application would typically have a PaymentType enum anyway.

        Activity

        bernard created issue -
        Hide
        Marc Logemann added a comment -

        I just wanted to migrate to OpenJPA 2.0.1 but this missing feature hindered me. Did it really got lost?

        Show
        Marc Logemann added a comment - I just wanted to migrate to OpenJPA 2.0.1 but this missing feature hindered me. Did it really got lost?
        Donald Woods made changes -
        Field Original Value New Value
        Component/s competitive [ 12313757 ]
        Hide
        Marc Logemann added a comment -

        Is this documented somwhere in the JPA docs that the enum ID feature is gone. I ve read a document where all the "changes" (from 1.x to 2.x) are documented but i cant remember reading something about Enums.

        Show
        Marc Logemann added a comment - Is this documented somwhere in the JPA docs that the enum ID feature is gone. I ve read a document where all the "changes" (from 1.x to 2.x) are documented but i cant remember reading something about Enums.
        Hide
        bernard added a comment -

        AFAIK JSR220 (EJB 3.0) and JSR317 (JPA 2.0) do not include enums in id fields. Marc, may I ask which provider you are using and why you want to migrate?

        Show
        bernard added a comment - AFAIK JSR220 (EJB 3.0) and JSR317 (JPA 2.0) do not include enums in id fields. Marc, may I ask which provider you are using and why you want to migrate?
        Hide
        bernard added a comment -

        Still not supported in 2.1.0

        All the others: TopLink, EclipseLink, DataNucleus, Hibernate support it.

        Show
        bernard added a comment - Still not supported in 2.1.0 All the others: TopLink, EclipseLink, DataNucleus, Hibernate support it.
        Hide
        Marc Logemann added a comment -

        I am still missing this feature heavily. Especially for Configuration Tables this would be really nice. Otherwise people continue to use static Strings as keys. old-school.

        Show
        Marc Logemann added a comment - I am still missing this feature heavily. Especially for Configuration Tables this would be really nice. Otherwise people continue to use static Strings as keys. old-school.

          People

          • Assignee:
            Unassigned
            Reporter:
            bernard
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development