the first dynamic prepend seems to be required
----------------------------------------------

         Key: IBATIS-315
         URL: http://issues.apache.org/jira/browse/IBATIS-315
     Project: iBatis for Java
        Type: Bug

  Components: SQL Maps  
    Versions: 2.1.7    
 Environment: Windows XP SP2, JDK 1.4.2
    Reporter: Doug Duong
    Priority: Minor


I have a statement defined as below:

    select ...
    from ...
    <dynamic prepend="where">
        <isNotNull property="prop1">
            text1
        </isNotNull>
        <isNotNull property="prop2" prepend="and">
            text2
        </isNotNull>
    </dynamic>

If both prop1, prop2 are not null, it produces a sql like this:
    select ...
    from ...
    where
        text1
        text2
=> Although a prepend "and" is specified for "prop2", it is not added before 
"text2". However, if I specify a prepend "and" for "prop1", then the sql is 
produced correctly: an "and" is added before "text2". Therefore, I say the 
first prepend must be always specified. Am I right?

-- 
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

Reply via email to