ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Problem with dynamic query.
Date Wed, 22 Mar 2006 07:52:22 GMT
You cannot use an iterated property in the decision tags. I believe
there is a JIRA issue for this.

<isNotNull property="contentBeanTrees[].detailsTable"> --> not allowed

Niels

-----Original Message-----
From: Daniel Pitts [mailto:Daniel.Pitts@cnet.com] 
Sent: woensdag 22 maart 2006 2:44
To: user-java@ibatis.apache.org
Subject: 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>

Mime
View raw message