Author: tomdz Date: Wed Apr 19 11:33:56 2006 New Revision: 395342 URL: http://svn.apache.org/viewcvs?rev=395342&view=rev Log: Added overridable method that returns the betwixt mapping used by DdlUtils; this fixes DDLUTILS-99
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java?rev=395342&r1=395341&r2=395342&view=diff ============================================================================== --- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java (original) +++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java Wed Apr 19 11:33:56 2006 @@ -90,6 +90,17 @@ } /** + * Returns the commons-betwixt mapping file as an [EMAIL PROTECTED] org.xml.sax.InputSource} object. + * Per default, this will be classpath resource under the path <code>/mapping.xml</code>. + * + * @return The input source for the mapping + */ + protected InputSource getBetwixtMapping() + { + return new InputSource(getClass().getResourceAsStream("/mapping.xml")); + } + + /** * Returns a new bean reader configured to read database models. * * @return The reader @@ -106,7 +117,7 @@ { reader.setEntityResolver(new LocalEntityResolver()); } - reader.registerMultiMapping(new InputSource(getClass().getResourceAsStream("/mapping.xml"))); + reader.registerMultiMapping(getBetwixtMapping()); return reader; } @@ -121,7 +132,7 @@ { BeanWriter writer = new BeanWriter(output); - writer.getXMLIntrospector().register(new InputSource(getClass().getResourceAsStream("/mapping.xml"))); + writer.getXMLIntrospector().register(getBetwixtMapping()); writer.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(true); writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(false); writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new HyphenatedNameMapper());