You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by alebu <al...@gmail.com> on 2010/05/19 13:14:18 UTC

API for runtime assembling of ibatis configuration elements

Hi, I have some ibatis API question:
Is it possible to assemble configuration elements like resultMap's or
queries in runtime using API only? Can these API generated elements
reference to those that comes from XML configuration? It can be useful in
some situations, like using custom query builder where conditions may be
very dynamic (for example, users could provide them). Or set of columns may
be provided too (together with resultMap) based on some dynamic
configuration. In this way ibatis still can be useful because of cache or
just by reusing some resultMap's when assembling your own more complex one.
Or maybe the whole ibatis configuration may be described in Guice style, in
java code (Lots of people like it because of type-safe refactoring). Main
question here is: is it OK to use ibatis in this way too or it is not
recomended?

Re: API for runtime assembling of ibatis configuration elements

Posted by Clinton Begin <cl...@gmail.com>.
Version 3, yes.  Version 2, no.

Cheers,
Clinton

On Wed, May 19, 2010 at 5:14 AM, alebu <al...@gmail.com> wrote:

> Hi, I have some ibatis API question:
> Is it possible to assemble configuration elements like resultMap's or
> queries in runtime using API only? Can these API generated elements
> reference to those that comes from XML configuration? It can be useful in
> some situations, like using custom query builder where conditions may be
> very dynamic (for example, users could provide them). Or set of columns may
> be provided too (together with resultMap) based on some dynamic
> configuration. In this way ibatis still can be useful because of cache or
> just by reusing some resultMap's when assembling your own more complex one.
> Or maybe the whole ibatis configuration may be described in Guice style, in
> java code (Lots of people like it because of type-safe refactoring). Main
> question here is: is it OK to use ibatis in this way too or it is not
> recomended?
>