Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6AC4E788F for ; Sat, 24 Sep 2011 14:36:52 +0000 (UTC) Received: (qmail 62287 invoked by uid 500); 24 Sep 2011 14:36:52 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 62269 invoked by uid 500); 24 Sep 2011 14:36:52 -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 62261 invoked by uid 99); 24 Sep 2011 14:36:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Sep 2011 14:36:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.213.171] (HELO mail-yx0-f171.google.com) (209.85.213.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Sep 2011 14:36:47 +0000 Received: by yxt3 with SMTP id 3so4769455yxt.16 for ; Sat, 24 Sep 2011 07:36:26 -0700 (PDT) Received: by 10.236.77.202 with SMTP id d50mr28873613yhe.120.1316874986134; Sat, 24 Sep 2011 07:36:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.169.12 with HTTP; Sat, 24 Sep 2011 07:36:06 -0700 (PDT) In-Reply-To: References: From: Michael Gentry Date: Sat, 24 Sep 2011 10:36:06 -0400 Message-ID: Subject: Re: Complex RelationShip in Modeler vs in Code To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Bruno, I just wrote a small test-case which used: Source -> Middle ->> Target Using source.getMiddle().getTargets() succeeds, but using source.getFlattenedTargets() fails. The faults are never triggered so the data is never faulted in from the database. This seems like a bug. Two options: 1) Add a prefetch to your query to force the Target to be present: query.addPrefetch(Source.FLATTENED_TARGETS_PROPERTY); 2) Add a cover method in Source.java to fetch Targets lazily and not even model the flattened relationship. Hope that helps for now. mrg On Fri, Sep 23, 2011 at 12:17 PM, Bruno Ren=E9 Santos = wrote: > Hi Michael, > > I dont mind having read-only relationships. > The problem here is that I have a flattened relationship that returns an > empty set when its unflattened counterpart returns values.... > > Thanx > Bruno > > On Fri, Sep 23, 2011 at 4:26 PM, Michael Gentry wr= ote: > >> Hi Bruno, >> >> I got the screenshot. =A0It looks like you are trying to flatten the >> relationship in the modeler: >> >> http://cayenne.apache.org/doc30/cayennemodeler-flattened-relationships.h= tml >> >> I haven't done this often, but it should work. =A0Play around with it a >> bit more. =A0Also, keep in mind this is going to give you read-only >> records, which may not be what you are wanting. >> >> mrg >> >> >> On Fri, Sep 23, 2011 at 9:21 AM, Bruno Ren=E9 Santos >> wrote: >> > Hi Michael I dont know if we are talking about the same thing but what= I >> did >> > was use the Cayenne Modeler to create a method getCausaArray() (see im= age >> in >> > attach.) which should be the same as >> > getToAvaliacaoMetrica().getCausaArray()... But for me the first is emp= ty >> and >> > the second is not... >> > >> > Thanx >> > Bruno >> > >> > On Fri, Sep 23, 2011 at 1:22 PM, Michael Gentry >> > wrote: >> >> >> >> Hi Bruno, >> >> >> >> I might be mistaken, but it sounds like you are saying when you used >> >> readNestedProperty() you ended up with an empty array, but when you >> >> used getPerson().getTelephoneNumberArray() it worked? =A0If so, make >> >> sure you are using the right property names and syntax in >> >> readNestedProperty(). >> >> >> >> Thanks, >> >> >> >> mrg >> >> >> >> >> >> On Wed, Sep 21, 2011 at 10:49 AM, Bruno Ren=E9 Santos > > >> >> wrote: >> >> > Hello all, >> >> > >> >> > I have created a complex relationship within the Modeler (like >> >> > toPerson->telephoneNumberArray). My problem is that when I access t= he >> >> > property the array comes up empty but if at the same time I call th= e >> >> > getPerson().getTelephoneNumberArray() it returns results... When ar= e >> >> > these >> >> > relationships within the modeler updated? And how they relate to th= e >> >> > comparable java call? >> >> > >> >> > Thanx >> >> > Bruno >> >> > >> >> > -- >> >> > Bruno Ren=E9 Santos | brunorene@holos.pt | Gestor de Projectos | >> Analista >> >> > | >> >> > Programador | Investigador >> >> > >> >> > Holos - Solu=E7=F5es Avan=E7adas em Tecnologias de Informa=E7=E3o S= .A. >> >> > Parque de Ci=EAncia e Tecnologia de Almada/Set=FAbal . Edif=EDcio M= adan >> Parque >> >> > Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portug= al >> >> > Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt >> >> > >> >> > This email and any files transmitted with it are confidential and >> >> > intended >> >> > solely for the use of the individual or entity to whom they are >> >> > addressed. >> >> > If you are not the intended recipient or the person responsible for >> >> > delivering the email to the intended recipient, be advised that you >> have >> >> > received this email in error and that any use, dissemination, >> >> > forwarding, >> >> > printing, or copying of this email is strictly prohibited. If you h= ave >> >> > received this email in error please notify Bruno Ren=E9 Santos by >> >> > telephone on >> >> > +351 210 438 686 >> >> > >> >> >> > >> > >> > >> > -- >> > Bruno Ren=E9 Santos | brunorene@holos.pt | Gestor de Projectos | Anali= sta >> | >> > Programador | Investigador >> > >> > Holos - Solu=E7=F5es Avan=E7adas em Tecnologias de Informa=E7=E3o S.A. >> > Parque de Ci=EAncia e Tecnologia de Almada/Set=FAbal . Edif=EDcio Mada= n Parque >> > Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal >> > Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt >> > >> > This email and any files transmitted with it are confidential and >> intended >> > solely for the use of the individual or entity to whom they are >> addressed. >> > If you are not the intended recipient or the person responsible for >> > delivering the email to the intended recipient, be advised that you ha= ve >> > received this email in error and that any use, dissemination, forwardi= ng, >> > printing, or copying of this email is strictly prohibited. If you have >> > received this email in error please notify Bruno Ren=E9 Santos by tele= phone >> on >> > +351 210 438 686 >> > >> >> > > > -- > Bruno Ren=E9 Santos | brunorene@holos.pt | Gestor de Projectos | Analista= | > Programador | Investigador > > Holos - Solu=E7=F5es Avan=E7adas em Tecnologias de Informa=E7=E3o S.A. > Parque de Ci=EAncia e Tecnologia de Almada/Set=FAbal . Edif=EDcio Madan P= arque > Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal > Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt > > This email and any files transmitted with it are confidential and intende= d > solely for the use of the individual or entity to whom they are addressed= . > If you are not the intended recipient or the person responsible for > delivering the email to the intended recipient, be advised that you have > received this email in error and that any use, dissemination, forwarding, > printing, or copying of this email is strictly prohibited. If you have > received this email in error please notify Bruno Ren=E9 Santos by telepho= ne on > +351 210 438 686 >