cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Complex RelationShip in Modeler vs in Code
Date Sat, 24 Sep 2011 14:36:06 GMT
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é Santos <brunorene@holos.pt> 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 <mgentry@masslight.net>wrote:
>
>> Hi Bruno,
>>
>> I got the screenshot.  It looks like you are trying to flatten the
>> relationship in the modeler:
>>
>> http://cayenne.apache.org/doc30/cayennemodeler-flattened-relationships.html
>>
>> I haven't done this often, but it should work.  Play around with it a
>> bit more.  Also, 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é Santos <brunorene@holos.pt>
>> 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 image
>> in
>> > attach.) which should be the same as
>> > getToAvaliacaoMetrica().getCausaArray()... But for me the first is empty
>> and
>> > the second is not...
>> >
>> > Thanx
>> > Bruno
>> >
>> > On Fri, Sep 23, 2011 at 1:22 PM, Michael Gentry <mgentry@masslight.net>
>> > 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?  If 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é Santos <brunorene@holos.pt
>> >
>> >> wrote:
>> >> > Hello all,
>> >> >
>> >> > I have created a complex relationship within the Modeler (like
>> >> > toPerson->telephoneNumberArray). My problem is that when I access
the
>> >> > property the array comes up empty but if at the same time I call the
>> >> > getPerson().getTelephoneNumberArray() it returns results... When are
>> >> > these
>> >> > relationships within the modeler updated? And how they relate to the
>> >> > comparable java call?
>> >> >
>> >> > Thanx
>> >> > Bruno
>> >> >
>> >> > --
>> >> > Bruno René Santos | brunorene@holos.pt | Gestor de Projectos |
>> Analista
>> >> > |
>> >> > Programador | Investigador
>> >> >
>> >> > Holos - Soluções Avançadas em Tecnologias de Informação S.A.
>> >> > Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan
>> 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
>> 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é Santos by
>> >> > telephone on
>> >> > +351 210 438 686
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Bruno René Santos | brunorene@holos.pt | Gestor de Projectos | Analista
>> |
>> > Programador | Investigador
>> >
>> > Holos - Soluções Avançadas em Tecnologias de Informação S.A.
>> > Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan 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 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é Santos by telephone
>> on
>> > +351 210 438 686
>> >
>>
>>
>
>
> --
> Bruno René Santos | brunorene@holos.pt | Gestor de Projectos | Analista |
> Programador | Investigador
>
> Holos - Soluções Avançadas em Tecnologias de Informação S.A.
> Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan 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 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é Santos by telephone on
> +351 210 438 686
>

Mime
View raw message