FAQ
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.

Search Discussions

  • Anonymous at Aug 29, 2008 at 5:08 pm
    [ 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.
  • Anonymous at Aug 29, 2008 at 5:13 pm
    [ https://issues.apache.org/cayenne/browse/CAY-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13089#action_13089 ]

    John Armstrong commented on CAY-1102:
    -------------------------------------

    Did not see that, thanks Andrus and sorry for the dup report.

    John-
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedAug 29, '08 at 4:59p
activeAug 29, '08 at 5:13p
posts3
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 3 posts

People

Translate

site design / logo © 2022 Grokbase