You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org> on 2008/08/29 19:08:11 UTC

[jira] Closed: (CAY-1102) Modeler creates invalid PK ID attribute maps for PK ID getter

     [ https://issues.apache.org/cayenne/browse/CAY-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik closed CAY-1102.
--------------------------------

    Resolution: Duplicate

Hi John,
You may have missed that I opened a similar Jira myself (CAY-1097) , and it is already fixed and will be released as  a part of M5. BTW the problem was not with PK , but rather with any attribute mapped as a Java primitive.

> Modeler creates invalid PK ID attribute maps for PK ID getter
> -------------------------------------------------------------
>
>                 Key: CAY-1102
>                 URL: https://issues.apache.org/cayenne/browse/CAY-1102
>             Project: Cayenne
>          Issue Type: Bug
>          Components: CayenneModeler GUI
>    Affects Versions: 3.0
>         Environment: Mac OS X 10.5
>            Reporter: John Armstrong
>            Assignee: Andrus Adamchik
>
> Using M4 I map my PK field (id) to an object field as per the wiki
> here : http://cwiki.apache.org/CAY/mapping-primary-keys.html
> In my generated class these two functions are added:
>    public void setId(int id) {
>        writeProperty("id", id);
>    }
>    public $classGen.formatJavaType(${attr.Type}) getId() {
>        Object value = readProperty("id");
>        return (value != null) ? (Integer) value : 0;
>    }
> The getId() doesn't compile as it looks like something is not
> interpolating cleanly during class generation?
> Also,  the PK value is not generated into the object (According to my
> debugger at least).
> This is using the Modeler tool (not ant).
> No custom templates are involved, it is an 'out of the box' installation.
> Java Type is int.
> No warnings are given etc, everything seems fine but invalid code is generated.
> Have not tested under Windows or Linux, only Mac OS X using the native modeler.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.