ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Ellis <mar...@ellis.name>
Subject Reading more than one file with XMLConfigBuilder
Date Tue, 20 Oct 2009 17:03:25 GMT
Hi

I wanted to run this feature request past the list, before filing a
JIRA issue...

The iBATIS configuration file allows a number of different
environments (including database names and credentials) to be
specified.  These are identified by environment name.  The
configuration file is parsed by the XMLConfigBuilder class.

Now, I'm writing a library that uses iBATIS.  The library will
eventually be used by a number of different applications connecting to
various databases.  I don't want to (and neither am I able to) list
every single database instance that the library will connect to in a
single configuration file that is included with my library.

I *could* put an iBATIS configuration file in every project that uses
my library... but I don't want to duplicate the other aspects of the
configuration file (such as the type aliases) in each project.

So what are the options here?

The XMLConfigBuilder constructor (the class that parses the config
file) creates a new Configuration instance per XMLConfigBuilder
instance, and it's only possible to specify a single Reader for a
given XMLConfigBuilder.

This seems to mean that I can't have the type aliases in an XML file
in my library, and the environments in a separate XML file in the
applications, and then combine the two, for the actual configuration.
Is that right?

I was thinking of filing an issue for the API to be modified to allow
more than one configuration file to be used.

What do you think?

Martin

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