cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Armstrong" <siber...@gmail.com>
Subject PK ID retrieval code generation seems to fail
Date Sun, 17 Aug 2008 09:38:01 GMT
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).

I'll go redesign my database better (The Right Answer)  but if this is
an issue it might be a good fix for a future release, assuming its a
bug and I am understanding correctly.

John

Mime
View raw message