Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 90181 invoked from network); 4 Apr 2006 14:58:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Apr 2006 14:58:54 -0000 Received: (qmail 53946 invoked by uid 500); 4 Apr 2006 14:58:53 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 53925 invoked by uid 500); 4 Apr 2006 14:58:53 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 53916 invoked by uid 99); 4 Apr 2006 14:58:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 07:58:53 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of cypher6x@hotmail.com designates 64.4.19.22 as permitted sender) Received: from [64.4.19.22] (HELO hotmail.com) (64.4.19.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 07:58:51 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 4 Apr 2006 07:58:31 -0700 Message-ID: Received: from 64.4.19.200 by by109fd.bay109.hotmail.msn.com with HTTP; Tue, 04 Apr 2006 14:58:30 GMT X-Originating-IP: [132.185.144.15] X-Originating-Email: [cypher6x@hotmail.com] X-Sender: cypher6x@hotmail.com From: "Cyp her" To: cayenne-user@incubator.apache.org Subject: cayenne get accessors Date: Tue, 04 Apr 2006 14:58:30 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 04 Apr 2006 14:58:31.0102 (UTC) FILETIME=[3CD955E0:01C657F8] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Does Cayenne force you to have *get* before your property name to create your get accessor e.g. getName(). I have a table like this PERSON id firstName lastName and the Modeler creates these accessors public class _Person extends CayenneDataObject { public String getFirstName() ... public String getLastName() ... } Which is fine. I have read you can get custom templates to change this and I did try by grabbing the default templates from the jar and modifying them but this did not work. Does anybody know how? My real problems start here however. In the subclass Person I have this code public class Person extends _Person { public String fullName() { return this.getFirstName() + � � + this.getLastName(); } } and when I try and use and Expression to get a particular Person like this Expression fullNameQualifier = ExpressionFactory.matchExp("fullName", �John Doe�); List filteredPersons = fullNameQualifier.filterObjects(personsList); The List is always empty even though I do have a person named John Doe in my database (MySQL). But oddly enough if I change my method in the Person class to be this public class Person extends _Person { public String getFullName() { return this.getFirstName + � � + this.getLastName; } } i.e. change the method name to be getFullName instead of just fullName. Why must I prefix all my get accessors with *get*? I want to get rid of *get* in all the super classes too so does anyone have a template I can use to oust them? Lawrence _________________________________________________________________ Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters