ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yaojian <sky...@gmail.com>
Subject Embed inline-parameter-map in simple-dynamic-sql element?
Date Mon, 12 Jan 2009 06:43:54 GMT
Hi,

How to make the IBatis.NET support embedding inline-parameterpmap in
simple-dynamic-sql element ?

For example, I have the following pseudocode:
==================================================
in the sql map:

        <select id="DynamicSqlStatement"
resultClass="System.Collections.IDictionary" parameterClass="String">
                $__DynamicSql$
        </select>

and in code:

Hashtable paramObject = new Hashtable();
paramObject.Add("__DynamicSql", "SELECT CATALOG_NAME, SCHEMA_NAME FROM
INFORMATION_SCHEMA.SCHEMATA WHERE (CATALOG_NAME =
#CatalogName,dbType=NVarChar#)";
paramObject.Add("CatalogName", "master");

Mapper.QueryForList<IDictionary>("DynamicSqlStatement", paramObject);

=========================================================

Currently, this result is a sql exception as the IBaits.NET send the text of
"__DynamicSql" directly to the sql server and so the "
#CatalogName,dbType=NVarChar#" is not a valid sql fragement.

I want the IBatis.NET treat the "CatalogName" as an inline-parameter-map
instead of send the original text of "__DynamicSql" directly to sql server.

It's may require the IBatis.NET parse the content of a mapped-statement
recursively?

Mime
View raw message