Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow XMLConfigBuilder to read more than one config file. #19

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 5 comments
Open

Comments

@GoogleCodeExporter
Copy link

Reporter:    Martin Ellis

Originally reported here:
http://www.mail-archive.com/user-java@ibatis.apache.org/msg14963.html

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.

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.

It'd be good to be able to separate out environment specific config
data from other ibatis config.

This means that it's not possible to keep the type aliases in an XML file
in a library, and the environments in a separate XML file in applications
using that library, and have the two combined at runtime.

Original issue reported on code.google.com by clinton....@gmail.com on 17 May 2010 at 1:41

@GoogleCodeExporter
Copy link
Author

Original comment by clinton....@gmail.com on 17 May 2010 at 3:22

  • Added labels: Type-Feature, Priority-Low, Version-Release3.x, Component-SqlMaps
  • Removed labels: Type-Enhancement, Priority-Medium

@GoogleCodeExporter
Copy link
Author

Original comment by clinton....@gmail.com on 17 May 2010 at 3:22

  • Changed state: New

@GoogleCodeExporter
Copy link
Author

Original comment by clinton....@gmail.com on 2 Jun 2010 at 4:46

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

I think this issue and issue #3 could both be solved by a general include 
mechanism in the config builders.

Would it be enough to have a separate config file for each environment that 
includes a common set of type aliases (or other elements)?

Original comment by hpresnall@gmail.com on 15 Oct 2010 at 3:48

@GoogleCodeExporter
Copy link
Author

Please, implement this feature. I don't understand why it was not made in the 
very first version of mybatis since all aliases and type handlers moved from 
mapper to configuration (since ibatis 2.x) and could not be shared by related 
project unless configurations can be combined. 

Original comment by chpa...@gmail.com on 3 Jan 2011 at 3:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant