db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <mccallis...@forthillcompany.com>
Subject Re: PersistentFields per class descriptors. was [RFC] Using java.lang.reflect.Proxy
Date Mon, 15 Mar 2004 14:15:58 GMT
There is already a PersistentFieldAutoDetectThingieMaBob in OJB which 
first looks for field acccess, then tries bean property, then tries 
dynabean, then gives up. It is a bit ugly as the reflection API throws 
an exception to signal it cannot find something, but I have used it and 
it works.

-Brian

On Mar 15, 2004, at 9:05 AM, Thomas Dudziak wrote:

> On Mon, 15 Mar 2004, Leandro Rodrigo Saad Cruz wrote:
>
>> I really think this is a desirable feature. I'm trying to use
>> DynamicProxy objects work with obj and the PersistentFieldClass must
>> call its getters and setters, but this is not true for other objects
>> where calling getters/setters is not an option. So, obj should provide
>> different PersistentFieldClass at the class/field level.
>
> A quick fix for you would be to combine the two field handlers to one
> handler that first tries to access the field directly, and if that 
> fails,
> searches for accessors (the 'fast' way) or vice versa (the 'safe' way 
> in
> case the getters/setters do something other than returning/setting the
> field).
> I'd rather avoid doing big metadata changes before 1.0, and such a 
> handler
> would be useful anyway.
>
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message