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

superclass generation with inheritance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      preconditions: cayenne model with inherited object entities.
      suspected bug: the resulting generated classes are duplicating property keys, getters and setters

      For example defining entity Apple inheriting from entity Fruit will generate following set of classes:

      Apple extends _Apple extends Fruit extends _Fruit

      The _Fruit.java defines all property keys, getters and setters for the attributes and relationships, also the PK column. _Apple.java does not have to re-define those, yet it only skips attributes, and keeps re-defining relationships and PK. (please see the pseudocode example below)

      not sure if that is intended or not.

      _Fruit.java
      //attributes
      public static final String KIND_PROPERTY = "kind";
      public static final String WEIGHT_PROPERTY = "weight"
      //relationships
      public static final String SUPPLIER_PROPERTY = "supplier";

      //PK
      public static final String ID_PK_COLUMN = "id";

      //attribute getters/setters
      getKind()
      setKind()
      getWeight()
      setWeight()
      //relationship getters/setters
      getSupplier()
      setSupplier()

      _Apple.java
      //attributes
      skipped...
      //relationships
      public static final String SUPPLIER_PROPERTY = "supplier";

      //PK
      public static final String ID_PK_COLUMN = "id";

      //attribute getters/setters
      skipped...
      //relationship getters/setters
      getSupplier()
      setSupplier()

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marcin Marcin Skladaniec
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: