[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] join fetch fails with "DotNode cannot be cast to VariableNode"

Hi Tom,

Thanks for your replies.

In the spec (persistence-2_0-final-spec.pdf) we have:

fetch_join ::= [ LEFT [OUTER] | INNER ] JOIN FETCH join_association_path_expression
join_association_path_expression ::= join_collection_valued_path_expression | join_single_valued_path_expression
join_single_valued_path_expression ::= identification_variable.{single_valued_embeddable_object_field.}*single_valued_object_field

The funny thing is that I did not find the definition of "single_valued_embeddable_object_field" in the spec.
Regards,
   Constantino.

________________________________

------------------------------

Message: 2
Date: Mon, 06 Dec 2010 10:30:18 -0500
From: Tom Ware <tom.ware@xxxxxxxxxx>
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Subject: Re: [eclipselink-users] join fetch fails with "DotNode cannot
        be cast to VariableNode"
Message-ID: <4CFD018A.40409@xxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Constantino,

   My reading of the JPA specification is that a multi-level fetch is not
allowed in JPQL.

   I believe the bug here is that we are not throwing an exception that tells
you this.

   Our fetch join hint was added to cover this case.

-Tom

Cronemberger, Constantino wrote:
> Hi,
>
> I have these mappings:
>
> In TestClassA:
>
>     @OneToOne(fetch = FetchType.LAZY)
>     public TestClassB getObjectBLocalFk() {
>         return objectBLocalFk;
>     }
>
>
>
> In TestClassB:
>
>
>
>     @OneToOne(fetch = FetchType.LAZY)
>     @JoinColumn(name="objectALocal_Fk")
>     public TestClassA getObjectALocalFk() {
>         return objectALocalFk;
>     }
>
> In this example both relationships are one-to-one but with other types it also happens.
>
>
>
> I have tested the suggested workaround and it worked.
>
>
>
> Thanks,
>
>     Constantino.
>
>