I had written my own deproxifier thing for the .equals() method of all my 
entities, and then I found out about this one

Hibernate.getClass(o);  
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Hibernate.html#getClass(java.lang.Object)

Hope that helps




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lionel
Sent: Wednesday, September 17, 2008 9:36 AM
To: [email protected]
Subject: Re: [Stripes-users] Stripersist and cglib proxified class

Lionel wrote:
> Hi Aaron
>
>
> I add logs to EntityUtil.java: I can see that the
> deproxifyCglibClass() works fine: the Field accessor containing the
> Id is found. But ((Field) accessor).get(entity) always return null.
> I've logged the value of entity.toString (which return the Id value):
> the right value is displayed.
>
> Did someone manage to use stripersist with lazy loaded @ManyToOne ?



Found a solution: invoking the getter of the property instead of getting its
value solves the problem.
this doesn't work:
return ((Field) accessor).get(entity);

this works:
return org.apache.commons.beanutils.PropertyUtils.getProperty(entity,
((Field) accessor).getName());

I also had to remove the check for Entity annotation in
entityFormatter.format(Object) (called before deproxification...)



Lionel




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to