ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Is there a way to validate parameterClass and resultClass for each ibatis query before runtime?
Date Fri, 22 Jul 2005 18:24:43 GMT
In the 1.x releases, there was a XmlSqlMapValidator class that could
validate the maps at compile time:


While your developing your application, it is probably quite
inconvenient to start up your app server just to test your SQL Maps.
For this reason, a separate utility is provided for validating SQL
Maps. This validator can be run from within the Ant build tool for
simple build-time SQL Map validation. You can specify as many SQL map
config files as you like. By default the validator will look for the
relative to the classpath. If you want to specify a full file path, you
can do so by simply prefixing the resource path with “file:”. Here are
a few examples:

java com.ibatis.db.sqlmap.XmlSqlMapValidator SqlMapConfig1.xml
java com.ibatis.db.sqlmap.XmlSqlMapValidator
java com.ibatis.db.sqlmap.XmlSqlMapValidator

As mentioned, you can also run the validator from within an Ant build
script. Here’s an example target
using the <java> task:
<target name="validateMaps" depends="compile">
<java classpathref="classpath"
classname="com.ibatis.db.sqlmap.XmlSqlMapValidator" >
<arg value="examples/sqlmap/maps/SqlMapConfigExample.xml"/>
<arg value="file:C:/devt/sql/SqlMapConfig1.xml"/>

Note! The validator currently does not throw an exception in the case
of errors. Watch the build log!

I don't think it exists anymore.

--- Ed Griebel <edgriebel@gmail.com> wrote:

> This exact question was asked yesterday or Wednesday, you can
> probably
> find the thread in the archive.
> -ed
> On 7/22/05, Bing Zou <xiguamaillist@gmail.com> wrote:
> > Hi all,
> > 
> > We are doing a lot of refactoring and one issue came up was that
> > moving JavaBean, renaming or overloading setter/getters could break
> > the existing iBATIS queries. But we have to wait till runtime and
> test
> > every related functionality for that purpose.
> > 
> > I am wondering whether there is a way we could perform this kind of
> > validation in advance?
> > 
> > Thanks.
> > Bing
> >

View raw message