|
|
|
|
|
Re: [Teneo] Lazy ManyToOne [message #535305 is a reply to message #534996] |
Fri, 21 May 2010 23:43 |
Lemao Messages: 48 Registered: December 2009 |
Member |
|
|
Martin,
I made some progress here. The lazy loading issue seems to come down to Resolve Proxies set to true in my ManyToOne reference. The getXXX() was called, EMF was calling eIsProxy() on the javassist proxy which was triggering the load.
Once I turned that off the lazy loading worked.
[Updated on: Fri, 21 May 2010 23:53] Report message to a moderator
|
|
|
|
|
Re: [Teneo] Lazy ManyToOne [message #535650 is a reply to message #535351] |
Tue, 25 May 2010 07:00 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Lemao,
Yes the EAttributePropertyHandler is also used for DynamicEMF, therefore no get method is returned.
You can also put the getId logic in a utility method and then cast the object to a HibernateProxy (if it is this) and
get the id from the HibernateProxy without initialization:
if (o instanceof HibernateProxy) {
return ((HibernateProxy) o).getHibernateLazyInitializer().getIdentifier();
}
and the class like this:
((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
gr. Martin
Lemao wrote:
> Hi Martin,
> Just one comment: dont think it fixes the getReference(), get() calls,
> only when trying to use Teneo/JPA with the latest Hibernate 3.5.1-Final.
>
> I also came across another issue. Calling getId() on a proxy object
> trigger a database select even though the id is local to the proxy.
> After some investigation, it turns out that the persistentClass in
> hibernate has null idSetter/idGetter because the
> EAttributePropertyHandler.getMethod() always returns null.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.01938 seconds