Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 8262 invoked from network); 23 Feb 2007 15:50:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2007 15:50:03 -0000 Received: (qmail 53522 invoked by uid 500); 23 Feb 2007 15:50:10 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 53508 invoked by uid 500); 23 Feb 2007 15:50:10 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 53499 invoked by uid 99); 23 Feb 2007 15:50:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 07:50:10 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of farocco@hotmail.com designates 65.54.246.204 as permitted sender) Received: from [65.54.246.204] (HELO bay0-omc3-s4.bay0.hotmail.com) (65.54.246.204) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 07:49:57 -0800 Received: from hotmail.com ([65.54.175.82]) by bay0-omc3-s4.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 23 Feb 2007 07:49:37 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 23 Feb 2007 07:49:37 -0800 Message-ID: Received: from 209.4.252.100 by BAY104-DAV10.phx.gbl with DAV; Fri, 23 Feb 2007 15:49:34 +0000 X-Originating-IP: [209.4.252.100] X-Originating-Email: [farocco@hotmail.com] X-Sender: farocco@hotmail.com From: "Frank" To: References: <45DC441B.2080800@opensource.lk> <9E3C8A35-34A8-41D2-BE74-91B2E20889ED@objectstyle.org> Subject: How do I query a joined table in cayenne? Date: Fri, 23 Feb 2007 10:49:32 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 23 Feb 2007 15:49:37.0275 (UTC) FILETIME=[38AEF4B0:01C75762] X-Virus-Checked: Checked by ClamAV on apache.org Hello, I cannot figure out how to query the pcldds, pcdep4 fields What am I doing wrong? Thanks Frank ** Java Code Start DataContext context = DataContext.getThreadDataContext(); Integer[] hspArray = {new Integer(1), new Integer(5)}; Expression e = ExpressionFactory.inDbExp(Bsypemp.EMHSPPOUND_PK_COLUMN, hspArray); e = e.andExp(ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYLNM_PROPERTY, lname +"%")); e = e.andExp(ExpressionFactory.likeIgnoreCaseExp(Bsypemp.EMYFNM_PROPERTY, fname +"%")); // I'm lost here e = e.andExp(ExpressionFactory.likeIgnoreCaseExp(Bsypemp.class.DEPARTMENTS_PROPERTY, pcldds // +"%")); SelectQuery query = new SelectQuery(Bsypemp.class,e); List records = context.performQuery(query); ** Java Code End Here is my first class package stemc.cayenne.as400.auto; /** Class _Bsypemp was generated by Cayenne. * It is probably a good idea to avoid changing this class manually, * since it may be overwritten next time code is regenerated. * If you need to make any customizations, please use subclass. */ public class _Bsypemp extends org.objectstyle.cayenne.CayenneDataObject { public static final String E_MEMPPOUND_PROPERTY = "eMEMPpound"; public static final String E_MWPHPOUND_PROPERTY = "eMWPHpound"; public static final String EMOTSH_PROPERTY = "emotsh"; public static final String EMSCH_PROPERTY = "emsch"; public static final String EMYFNM_PROPERTY = "emyfnm"; public static final String EMYLNM_PROPERTY = "emylnm"; public static final String DEPARTMENTS_PROPERTY = "departments"; public static final String EMEMPPOUND_PK_COLUMN = "EMEMP#"; public static final String EMHSPPOUND_PK_COLUMN = "EMHSP#"; public void setEMEMPpound(java.math.BigDecimal eMEMPpound) { writeProperty("eMEMPpound", eMEMPpound); } public java.math.BigDecimal getEMEMPpound() { return (java.math.BigDecimal)readProperty("eMEMPpound"); } public void setEMWPHpound(java.math.BigDecimal eMWPHpound) { writeProperty("eMWPHpound", eMWPHpound); } public java.math.BigDecimal getEMWPHpound() { return (java.math.BigDecimal)readProperty("eMWPHpound"); } public void setEmotsh(String emotsh) { writeProperty("emotsh", emotsh); } public String getEmotsh() { return (String)readProperty("emotsh"); } public void setEmsch(String emsch) { writeProperty("emsch", emsch); } public String getEmsch() { return (String)readProperty("emsch"); } public void setEmyfnm(String emyfnm) { writeProperty("emyfnm", emyfnm); } public String getEmyfnm() { return (String)readProperty("emyfnm"); } public void setEmylnm(String emylnm) { writeProperty("emylnm", emylnm); } public String getEmylnm() { return (String)readProperty("emylnm"); } public void setDepartments(stemc.cayenne.as400.Bprppcp departments) { setToOneTarget("departments", departments, true); } public stemc.cayenne.as400.Bprppcp getDepartments() { return (stemc.cayenne.as400.Bprppcp)readProperty("departments"); } } Here is my second class package stemc.cayenne.as400.auto; /** Class _Bprppcp was generated by Cayenne. * It is probably a good idea to avoid changing this class manually, * since it may be overwritten next time code is regenerated. * If you need to make any customizations, please use subclass. */ public class _Bprppcp extends org.objectstyle.cayenne.CayenneDataObject { public static final String PCDEP4_PROPERTY = "pcdep4"; public static final String PCINA_PROPERTY = "pcina"; public static final String PCLDDS_PROPERTY = "pcldds"; public static final String PCSDDS_PROPERTY = "pcsdds"; public static final String PCDEP4_PK_COLUMN = "PCDEP4"; public static final String PCHSPPOUND_PK_COLUMN = "PCHSP#"; public void setPcdep4(java.math.BigDecimal pcdep4) { writeProperty("pcdep4", pcdep4); } public java.math.BigDecimal getPcdep4() { return (java.math.BigDecimal)readProperty("pcdep4"); } public void setPcina(String pcina) { writeProperty("pcina", pcina); } public String getPcina() { return (String)readProperty("pcina"); } public void setPcldds(String pcldds) { writeProperty("pcldds", pcldds); } public String getPcldds() { return (String)readProperty("pcldds"); } public void setPcsdds(String pcsdds) { writeProperty("pcsdds", pcsdds); } public String getPcsdds() { return (String)readProperty("pcsdds"); } }