ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: How to programmatically configure mappers from XML?
Date Thu, 12 Nov 2009 15:44:14 GMT
Nope, that's correct... the Configuration class is unaware of the methods by
which it is created.

We might be able to add a method to to SqlSessionFactory that would allow
you to pass in a Configuration instance and a Reader...

Please file a Jira ticket for the request and we'll see what we can do in
the next feature release.

Clinton

On Wed, Nov 11, 2009 at 6:40 PM, Jonathan Gold <jgold.bg@gmail.com> wrote:

> I'm new to iBatis, and decided to learn to use iBatis3.
>
> It seemed from the PDF doc that I should be able to programmatically
> configure
> everything, but I can't find a way to add mappers specified in an xml file
> to a
> configuration. That is, what I would like to do is something like the
> following:
>
>    Configuration c = new Configuration();
>    //... set various c things
>
>    Mapper m = loadMapperFromXml( ".../path/to/mapper.xml" );
>    c.addMapper( m );
>
>    SqlSessionFactory ssf = new SqlSessionFactoryBuilder.build( c );
>
> But there doesn't seem to be any way to do that. The best I can come up
> with for
> the moment is to build an XML doc in memory, serialize it to a byte[] and
> wrap
> that in a Reader, and then pass that to the
> SqlSessionFactoryBuilder.build()
> method.
>
> Am I overlooking things?
>
> jon
>
> ---------------------------------------------------------------------
> 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