ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Gooch <mrwiz...@k12system.com>
Subject RE: Using Map as a parameter object
Date Mon, 21 Dec 2009 13:45:22 GMT
> -----Original Message-----
> From: Martin Ellis [mailto:ellis.m.a@gmail.com] 
> Sent: Sunday, December 20, 2009 9:49 PM
> To: user-java@ibatis.apache.org
> Subject: Re: Using Map as a parameter object
> 
> On Mon, Dec 21, 2009 at 2:39 AM, Martin Ellis 
> <ellis.m.a@gmail.com> wrote:
> > My only reservation with the patches you've provided is that they
> > break the semantics of map (e.g. size() no longer returns a sensible
> > value, keySet() doesn't return all valid keys, ...).  However, since
> > these values aren't available to the OGNL interpreter (that's the
> > point of the ContextAccessor class), I don't see that being 
> a problem.
> 
> I tell a lie... they *are* available to the interpreter as 
> _parameter.size
> and _parameter.keys.
> 
> Still, I struggle to imagine anyone actually using those values...

Except that _parameter points to the original parameterobejct, not the ContextMap.  So _parameter.size
and _parameter.keys will refer back to the original Map implementation, which hopefully implemented
those methods.  (Though if it didn't, it's not something we can fix)

Would it make more sense to modify the ContextAccessor such that when it does a get, it checks
to see if _parameter is a Map, and if so, does a get against it?  Then we can leave the ContextMap
structure alone entirely.

http://users.k12system.com/mrwizard/software/ibatis-3beta7-mapfix3.patch

This also passes my unit tests.

Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message