Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-28 Thread Emmanuel Bernard
JPA today mandates that clients access getters and setters. On 28 mai 07, at 05:37, Max Rydahl Andersen wrote: Field field = myClass.getField("myField"); Object value = field.get(proxy); value is always null because CGLIB does not fill the superclass fields. well - it shouldn't and you c

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-28 Thread Max Rydahl Andersen
Field field = myClass.getField("myField"); Object value = field.get(proxy); value is always null because CGLIB does not fill the superclass fields. well - it shouldn't and you couldn't rely on it even if it did since it might not be the right concrete type. But I can see that it's kind'a

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-27 Thread Emmanuel Bernard
Field field = myClass.getField("myField"); Object value = field.get(proxy); value is always null because CGLIB does not fill the superclass fields. ClassMetadata is very invasive in my code, I'd rather avoid that solution, most of my code is JPA compliant today. I'll stay with the HibernateP

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-24 Thread Max Rydahl Andersen
This is what I want to return one way or an other... or CGLIB should fill up the superclass fields. I don't understand ;) The parameter to Hibernate.initialize(x) is the *entity* right, not a *value* of that object ? And field access etc. works on that object. ClassMetaData.getPropertyV

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-24 Thread Emmanuel Bernard
This is what I want to return one way or an other... or CGLIB should fill up the superclass fields. On 24 mai 07, at 01:02, Max Rydahl Andersen wrote: afaik ( ( HibernateProxy ) value ).getHibernateLazyInitializer ().getImplementation() haven't changed almost since beginning of times. But

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-23 Thread Max Rydahl Andersen
afaik ( ( HibernateProxy ) value ).getHibernateLazyInitializer().getImplementation() haven't changed almost since beginning of times. But exposing it on the Hibernate class API would be wrong IMO since the return value would be the underlying object instead of the proxy, or do I misunderst

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-23 Thread Emmanuel Bernard
I know that Max :) I do not expose it to the user, it's just how HSearch internally deal with it during the transparent indexation process, so I do not break the == operation from a user point of view. Note that we expose that to the user anyway through load/initialize/get, I'm just begging

Re: [hibernate-dev] Hibernate.getImplementation(Object)

2007-05-23 Thread Max Rydahl Andersen
why are you ever in need of touching the field values directly ? Accessing and potentially exposing the underlying object of a proxied entity should be strictly prohibted since otherwise you easily end up with breaking == /max For Hibernate Search I came to a problem. When a user choose fie