Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1097

Attribute types are not generated for primitive ints

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M5
    • Core Library, Modeler
    • None
    • 3.0M4, class generation from CayenneModeler

    Description

      Not sure if this happens with cgen, but when generating classes from CayenneModeler, primitive int (and other primitives?) attributes result in broken code. This was initially described here:

      http://markmail.org/message/giz4mobirutx3ita

      The generated code looks like this:

      public void setId(int id)

      { writeProperty("id", id); }

      public $classGen.formatJavaType(${attr.Type}) getId()

      { Object value = readProperty("id"); return (value != null) ? (Integer) value : 0; }

      Attachments

        1. subclass
          0.9 kB
          dzmitar
        2. singleclass
          1 kB
          dzmitar
        3. ImportUtilsTest
          0.9 kB
          dzmitar
        4. importUtils
          1 kB
          dzmitar
        5. ClassGenerationActionTest.txt
          3 kB
          dzmitar

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: