You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Martin Zeltner (JIRA)" <ib...@incubator.apache.org> on 2005/12/23 15:19:30 UTC

[jira] Created: (IBATIS-238) Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on

Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on
------------------------------------------------------------------------------------------------

         Key: IBATIS-238
         URL: http://issues.apache.org/jira/browse/IBATIS-238
     Project: iBatis for Java
        Type: Bug
  Components: SQL Maps  
    Versions: 2.1.6    
 Environment: WinXp
    Reporter: Martin Zeltner
    Priority: Critical


A property of a bean that is in a list can not be used for testing. See attribute "property" of elements "isEquals" from example below:

    <select id="searchKeywords" resultMap="keyword" parameterClass="list">
        select KEYID, NAME, DESCRIPTION, OPTIMISTICLOCKINGVERSION from KEYWORDS
        <iterate prepend="where" conjunction="and">
            <isEqual property="[].type" compareValue="like">
                <isEqual property="[].field" compareValue="name">
                    <isEqual property="[].caseSensitive" compareValue="true">
                        NAME like #[].stringValue#
                    </isEqual>
                    <isNotEqual property="[].caseSensitive" compareValue="true">
                        upper(NAME) like upper(#[].stringValue#)
                    </isNotEqual>
                </isEqual>
                <isEqual property="[].field" compareValue="description">
                    <isEqual property="[].caseSensitive" compareValue="true">
                        DESCRIPTION like #[].stringValue#
                    </isEqual>
                    <isNotEqual property="[].caseSensitive" compareValue="true">
                        upper(DESCRIPTION) like upper(#[].stringValue#)
                    </isNotEqual>
                </isEqual>
            </isEqual>
        </iterate>
        order by NAME
    </select>

Regards,
Martin


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-238) Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-238?page=comments#action_12361727 ] 

Brandon Goodin commented on IBATIS-238:
---------------------------------------

There is a whiteboard discussion on a future dynamic sql implementation. I have worked extensively on this code and i would caution us to push this much further. It is difficult code to manage and change without breaking things. I would recommend that we devote ourselves to consideration of the next implementation of dynamic sql and not spend too much time on the current. I am going to look through the issues to find current dynamic sql reports to see what can be done to accomodate current desired features.

Improved Dynamic SQL Whiteboard:
http://opensource2.atlassian.com/confluence/oss/display/IBATIS/Improved+Dynamic+SQL+Whiteboard

> Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on
> ------------------------------------------------------------------------------------------------
>
>          Key: IBATIS-238
>          URL: http://issues.apache.org/jira/browse/IBATIS-238
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.6
>  Environment: WinXp
>     Reporter: Martin Zeltner
>     Priority: Critical
>  Attachments: baseprobe_patch.txt
>
> A property of a bean that is in a list can not be used for testing. See attribute "property" of elements "isEquals" from example below:
>     <select id="searchKeywords" resultMap="keyword" parameterClass="list">
>         select KEYID, NAME, DESCRIPTION, OPTIMISTICLOCKINGVERSION from KEYWORDS
>         <iterate prepend="where" conjunction="and">
>             <isEqual property="[].type" compareValue="like">
>                 <isEqual property="[].field" compareValue="name">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         NAME like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(NAME) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>                 <isEqual property="[].field" compareValue="description">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         DESCRIPTION like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(DESCRIPTION) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>             </isEqual>
>         </iterate>
>         order by NAME
>     </select>
> Regards,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (IBATIS-238) Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on

Posted by "Martin Zeltner (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-238?page=all ]

Martin Zeltner updated IBATIS-238:
----------------------------------

    Attachment: baseprobe_patch.txt

Here my patch for this.

> Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on
> ------------------------------------------------------------------------------------------------
>
>          Key: IBATIS-238
>          URL: http://issues.apache.org/jira/browse/IBATIS-238
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.6
>  Environment: WinXp
>     Reporter: Martin Zeltner
>     Priority: Critical
>  Attachments: baseprobe_patch.txt
>
> A property of a bean that is in a list can not be used for testing. See attribute "property" of elements "isEquals" from example below:
>     <select id="searchKeywords" resultMap="keyword" parameterClass="list">
>         select KEYID, NAME, DESCRIPTION, OPTIMISTICLOCKINGVERSION from KEYWORDS
>         <iterate prepend="where" conjunction="and">
>             <isEqual property="[].type" compareValue="like">
>                 <isEqual property="[].field" compareValue="name">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         NAME like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(NAME) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>                 <isEqual property="[].field" compareValue="description">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         DESCRIPTION like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(DESCRIPTION) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>             </isEqual>
>         </iterate>
>         order by NAME
>     </select>
> Regards,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-238) Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on

Posted by "Jeff Butler (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-238?page=comments#action_12361196 ] 

Jeff Butler commented on IBATIS-238:
------------------------------------

We definitiely need something like this for dynamic elements within an iterate tag.  But I wonder if this is the right way to solve it.  Does this work for nested iterate tags?  i.e. - can I do [].[].someProperty?

I wonder if it might be better to specify something like var=xxx in the iterate tag (like the JSTL forEach syntax)?
 
Great start on a solution to this problem!


> Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on
> ------------------------------------------------------------------------------------------------
>
>          Key: IBATIS-238
>          URL: http://issues.apache.org/jira/browse/IBATIS-238
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.6
>  Environment: WinXp
>     Reporter: Martin Zeltner
>     Priority: Critical
>  Attachments: baseprobe_patch.txt
>
> A property of a bean that is in a list can not be used for testing. See attribute "property" of elements "isEquals" from example below:
>     <select id="searchKeywords" resultMap="keyword" parameterClass="list">
>         select KEYID, NAME, DESCRIPTION, OPTIMISTICLOCKINGVERSION from KEYWORDS
>         <iterate prepend="where" conjunction="and">
>             <isEqual property="[].type" compareValue="like">
>                 <isEqual property="[].field" compareValue="name">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         NAME like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(NAME) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>                 <isEqual property="[].field" compareValue="description">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         DESCRIPTION like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(DESCRIPTION) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>             </isEqual>
>         </iterate>
>         order by NAME
>     </select>
> Regards,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-238) Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on

Posted by "Martin Zeltner (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-238?page=comments#action_12361574 ] 

Martin Zeltner commented on IBATIS-238:
---------------------------------------

No it works only for one array, but I didn't tested it. I think too that a forEach variable would be the better way than [] like it is now. BTW I have also problems to access a List from a Map. I couldn't make it work.

> Property of a bean from a list can not be used in a dynamic query in elements isEquals and so on
> ------------------------------------------------------------------------------------------------
>
>          Key: IBATIS-238
>          URL: http://issues.apache.org/jira/browse/IBATIS-238
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.6
>  Environment: WinXp
>     Reporter: Martin Zeltner
>     Priority: Critical
>  Attachments: baseprobe_patch.txt
>
> A property of a bean that is in a list can not be used for testing. See attribute "property" of elements "isEquals" from example below:
>     <select id="searchKeywords" resultMap="keyword" parameterClass="list">
>         select KEYID, NAME, DESCRIPTION, OPTIMISTICLOCKINGVERSION from KEYWORDS
>         <iterate prepend="where" conjunction="and">
>             <isEqual property="[].type" compareValue="like">
>                 <isEqual property="[].field" compareValue="name">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         NAME like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(NAME) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>                 <isEqual property="[].field" compareValue="description">
>                     <isEqual property="[].caseSensitive" compareValue="true">
>                         DESCRIPTION like #[].stringValue#
>                     </isEqual>
>                     <isNotEqual property="[].caseSensitive" compareValue="true">
>                         upper(DESCRIPTION) like upper(#[].stringValue#)
>                     </isNotEqual>
>                 </isEqual>
>             </isEqual>
>         </iterate>
>         order by NAME
>     </select>
> Regards,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira