ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict" <pbened...@apache.org>
Subject Re: Direct-to-Field mappings now implemented.
Date Wed, 14 Feb 2007 17:23:14 GMT
Clinton, perhaps you opened the can of worms here :-) But I think the idea
is very good and now we're seeing the feedback necessary to refine the
enhancement. Upon reflection (pun intended), I believe the configuration
option is becoming more and more necessary and so I expand my suggestion to
be a strategy of how to access properties:

propertyStrategy="method|field|method-field"

This attribute be set at the global of resultMap level. With the values
being:
method = only perform method access
field = only perform field access
method-field = perform method access first and then fallback to field

<resultMap ... propertyStrategy="method-field">
</resultMap>

NB: We're going to be doing something similar in Struts 1.4 that specifies
when to populate a form based on the type of request:
populate="request|forward|request-forward"

Paul

On 2/14/07, Brandon Goodin <brandon.goodin@gmail.com> wrote:
>
> Yes, this is a repost... but now that the point has come up...
>
> To avoid the unpredictability of this functionality couldn't we add some
> configure options like:
>
> * a diretoryToMappintEnabled=true /false property on the SQL Map Config.
> This would set it globally. False would follow strict bean and (eventually)
> constructor setting.
> * To bring further clarity we should define the lookup order in our docs.
> First a setter is attempted and then a property is attempted ( I would
> guess)
> * Perhaps you could even go as far as placing a reverseLookup=true/false
> field on mappings so that the field is examined before the setter this could
> be done in the inline and xml based mappings.
>
> Just some thoughts that may provide our usual implicit/explicit options.
> Layout the functionality to act in a common known way and provide the
> ability to tweak it when needed.
>
>
> Brandon
>
>

Mime
View raw message