ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gold <jgold...@gmail.com>
Subject Re: How to programmatically configure mappers from XML?
Date Thu, 12 Nov 2009 17:47:54 GMT
Martin --

I think it could be, but I went ahead and filed a separate issue with a note
that it may be a dupe of yours (which I'm now watching):

    https://issues.apache.org/jira/browse/IBATIS-689

Happy configurationizing!

jon

On Thu, Nov 12, 2009 at 04:52:05PM +0000, Martin Ellis wrote:
> I've already filed something similar:
> 
> https://issues.apache.org/jira/browse/IBATIS-682
> 
> Is that the same problem?
> 
> Cheers
> Martin
> 
> On Thu, Nov 12, 2009 at 3:44 PM, Clinton Begin <clinton.begin@gmail.com> wrote:
> > 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
> >>
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org

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