Uploaded image for project: 'OJB'
  1. OJB
  2. OJB-24

Feature Request: enumerates and field conversions

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1 CVS
    • 1.1 CVS
    • PB-API
    • None

    Description

      Hi,
      In my model I have enumerates which are represented as a java object in memory. An enumerate java object has an int and a String value. When the owner object is persisted I want to convert the enumerate object to either the int or the string and store it in a field. When the owner object is retrieved then the primitive type database field should be translated into the enumerate object.

      It seems logical to use fieldconversions to achieve this, however the field conversion interface only passes the value from the database and from this database value it can not be determined which Enumerate object should be created. This is so because different enumeratetypes can have the same value (with a different meaning). To identify which enumerate object should be created the fieldconversion interface could be extended so that also the field descriptor is passed.

      This is really just a very-low-priority-nice-to-have because there are many workarounds, e.g. store the enumerate class in the field also (etc.). But maybe somebody else also requires it or this has come-up earlier or maybe field conversions are looked at anyhow for a new larger release.

      gr. Martin Taal

      Attachments

        1. EMFEnumerationConverter.java
          3 kB
          Martin Taal

        Activity

          People

            tomdz Thomas Dudziak
            mtaal Martin Taal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment