ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Proposed Enhancement - Support Multiple Parameter Classes
Date Tue, 10 Oct 2006 20:40:59 GMT
Hi Larry,

If I understand correctly what your suggesting, I'm thinking we could do
something like this:

1. Put a Map in ThreadLocal in the SqlMapClient

2.  Add SqlMapCient methods like:
- clearThreadLocalMap()
- putThreadLocalData(String key, Object value)

3. Add some syntax to access these values in an SqlMap like this:
<insert id=InsertCustomer" class="customer">
  insert into customer (id, desc, audit_id)
  values (#id#, #desc#, #TL:audit_id#)
</insert>

Is that right?  That would certainly address my issue - and I think it would
be easier to implement that what I proposed.  I think I like it.

Jeff Butler




On 10/10/06, Larry Meadors <lmeadors@apache.org> wrote:
>
> IMO, it doesn't fit with the iBATIS philosophy.
>
> There are as many solutions to this as there are projects, and making
> a simple solution to this problem is not terribly likely.
>
> I tend to put as much of that in the DAO (via threadlocal storage) or
> in the database itself (via triggers, etc) as I can. That keeps it out
> of the application pretty well. It might be cool to be able to get to
> static data from a mapped statement - so like if i create a static
> method on a ThreadLocal to get the user name, etc...
>
> Just my $0.02 on it. :-)
>
> Larry
>
>
>

Mime
View raw message