Emanuele Maiarelli | 8 Jun 2012 00:07

Cayenne 3.0.2 rop and reflection.


I'm trying to move an application built around cayenne 2.0.4 to
3.0.2 and im facing an odd problem. 

I've some objects with 1 to n
relation, that calls to a generic method getTo...() via reflection, that
returns null, even if the underlaying database holds the correct
reference. 

So i tested the object calling the method without
reflection it works correcty. 

For instance: 

In this case 

ObjectContext newct=this.instance.getFreshContex(); // this methods
returns new CayenneContext(channel);
 SelectQuery sq=new
SelectQuery(Dochdrs.class);
 List  dd=newct.performQuery(sq);

this.instance.setupPrefetch(sq, Dochdrs.class,newct, 1);

 for (Dochdrs
doc:dd)
 {
 System.out.println(doc.getToCentrocosti().getCcDesc());
 }

(Continue reading)

Marco Gattei | 8 Jun 2012 10:18
Picon

Re: Cayenne 3.0.2 rop and reflection.

Ciao Emanuele,

     hai provato a attivare il log di Cayenne e vedere che query vengono 
eseguite ( e se vengo eseguite ) ?

Marco

Il 08/06/2012 00:07, Emanuele Maiarelli ha scritto:
>
>
> I'm trying to move an application built around cayenne 2.0.4 to
> 3.0.2 and im facing an odd problem.
>
> I've some objects with 1 to n
> relation, that calls to a generic method getTo...() via reflection, that
> returns null, even if the underlaying database holds the correct
> reference.
>
> So i tested the object calling the method without
> reflection it works correcty.
>
> For instance:
>
> In this case
>
>
> ObjectContext newct=this.instance.getFreshContex(); // this methods
> returns new CayenneContext(channel);
>   SelectQuery sq=new
> SelectQuery(Dochdrs.class);
(Continue reading)

Emanuele Maiarelli | 8 Jun 2012 11:42

Re: Cayenne 3.0.2 rop and reflection.


Ciao Marco, 

 yes i tried activating query logging, and when using
reflection cayenne seems to be unaware of the 

fact that the method is
being called and dosen't fetch the related object. 

Emanuele. 

On Fri,
08 Jun 2012 10:18:44 +0200, Marco Gattei wrote: 

> Ciao Emanuele,
> 
>
hai provato a attivare il log di Cayenne e vedere che query vengono 
>
eseguite ( e se vengo eseguite ) ?
> 
> Marco
> 
> Il 08/06/2012 00:07,
Emanuele Maiarelli ha scritto:
> 
>> I'm trying to move an application
built around cayenne 2.0.4 to 3.0.2 and im facing an odd problem. I've
some objects with 1 to n relation, that calls to a generic method
getTo...() via reflection, that returns null, even if the underlaying
(Continue reading)


Gmane