You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Daniel Pitts <Da...@cnet.com> on 2006/03/22 02:44:24 UTC

Problem with dynamic query.

I'm trying the following dynamic query, and ibatis throws an exception
on initialization. (Even before I call the query) The exception is a
Probe exception, cannot find ordinal for JavaBean , caused by
NumberFormatException from string "".
Can anyone tell me what I'm doing wrong?

Query:
    <select id="dynamicQuery" resultClass="java.util.HashMap"
parameterClass="java.util.Map">
        <dynamic>
        SELECT
            <iterate property="properties" conjunction=",">
                `$properties[].tableAlias$`.$properties[].sourceColumn$
AS `$properties[].path$`
            </iterate>
        FROM
            <iterate property="contentBeanTrees" conjunction="join">
                content AS `$contentBeanTrees[].contentTableAlias$`
                <isNotNull property="contentBeanTrees[].detailsTable">
                    JOIN $contentBeanTrees[].detailsTable$ AS
`$contentBeanTrees[].detailsTableAlias$`
                </isNotNull>
            </iterate>
            <iterate property="constraints" conjunction="AND"
prepend="WHERE">
 
`$constraints[].tableAlias$`.$constraints[].sourceColumn$=
                #constraints[].value#
            </iterate>
        </dynamic>
   </select>