ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: If all my sql is in xml, do I gain that much (assuming unit tests) using Mapper objects as well?
Date Wed, 17 Feb 2010 19:51:06 GMT
Using a mapper interface means you have a bit less code to write and
generics support comes for free without having to do the
@SuppressWarnings annotation.  Refactoring support is limited because
the mapper interface name and method names must match the XML - so
simply changing something in the mapper interface might break the
code.

The mapper is doing the same thing under the covers as what you
describe - so there's no other magic.  In my current project I'm using
the mapper interface because I like to write less code, and Ibator
generated most of the mapper methods anyway.

Jeff Butler


On Wed, Feb 17, 2010 at 1:38 PM, Rick R <rickcr@gmail.com> wrote:
> This probably has been brought up before, but a quick search on nabble
> didn't return anything that useful at the moment...
>
> Our plan is to have ALL sql in the mapper xml files (not annotations.) It
> 'seems' like the only real benefit we'd then get out of also providing a
> corresponding mapper object is for IDE support and catching of any invalid
> calls early on (and maybe refactoring is slightly cleaner but that's
> debatable.)  But assuming we have a unit test for every mapper sql command
> in our service layer, is there anything else I miss by skipping the whole
> creation of mapper objects and simply going after the sql the old way...
> session.update("fooBar.updateEmployee", obj) ? (I read pages 53/54 of the
> guide and nothing jumped out at me as a huge gain in our case using Mapper
> classes.)
>
> I just don't want to be overlooking anything.
>
> --
> Rick R
>

---------------------------------------------------------------------
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