cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcin Skladaniec (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAY-1538) superclass generation with inheritance
Date Wed, 09 Feb 2011 05:44:57 GMT

    [ https://issues.apache.org/jira/browse/CAY-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992331#comment-12992331
] 

Marcin Skladaniec commented on CAY-1538:
----------------------------------------

workaround for this issue is to define the relationships on the inheriting class level, not
the base entity.

> superclass generation with inheritance
> --------------------------------------
>
>                 Key: CAY-1538
>                 URL: https://issues.apache.org/jira/browse/CAY-1538
>             Project: Cayenne
>          Issue Type: Bug
>            Reporter: Marcin Skladaniec
>            Priority: Minor
>
> 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()

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message