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.
This archive was generated by hypermail 2.0.0 : Fri Aug 29 2008 - 13:08:33 EDT