ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Griebel <edgrie...@gmail.com>
Subject Re: Is there a way to validate parameterClass and resultClass for each ibatis query before runtime?
Date Fri, 22 Jul 2005 18:28:40 GMT
And it sounds like this is strictly to determine if the XML is
well-formed and valid. The trick is determining if the XML matches the
DB schema, which is a far more difficult (infinitely more difficult?)
problem.

-ed

On 7/22/05, Ron Grabowski <rongrabowski@yahoo.com> wrote:
> In the 1.x releases, there was a XmlSqlMapValidator class that could
> validate the maps at compile time:
> 
> ibatis_db_guide-1-2-9.pdf
> "
> Validation
> 
> 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
> files
> 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
> SqlMapConfig2.xml
> java com.ibatis.db.sqlmap.XmlSqlMapValidator
> com/domain/app/sql/SqlMapConfig1.xml
> java com.ibatis.db.sqlmap.XmlSqlMapValidator
> file:C:/devt/sql/SqlMapConfig1.xml
> 
> 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"/>
> </java>
> </target>
> 
> 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.
>

Mime
View raw message