日期:2014-05-16  浏览次数:21052 次

ibatis的isEqual下不能有CDATA吗,我这样做老是报错,求高手看看是怎么回事呀
sql语句配置:
XML code

<select id="queryJobProjiectCondition" remapResults="true" parameterClass="java.util.HashMap" resultClass="bean.JobProjiect">
        select * from IPWF_LOCAL_JOB_PROJECT where 1=1
        <isNotNull prepend="and" property="queryJobNumber">
            JOB_NUMBER like '%'||#queryJobNumber#||'%'
        </isNotNull>
        <isNotNull prepend="and" property="queryJobContent">
            JOB_CONTENT like '%'||#queryJobContent#||'%'
        </isNotNull>
        <isNotNull prepend="and" property="queryJobExecutorName">
            JOB_EXECUTOR_NAME like '%'||#queryJobExecutorName#||'%'
        </isNotNull>
        <isNotEmpty prepend="and" property="queryJobCycle">
            JOB_CYCLE = #queryJobCycle#
        </isNotEmpty>
        <isNotEmpty prepend="and" property="queryJobMode">
            JOB_MODE = #queryJobMode#
        </isNotEmpty>
        <isEqual prepend="and" property="queryPeriodOfValidity" compareValue="yes">
            <![CDATA[
                JOB_STATRTIME <= sysdate and JOB_ENDTIME >= sysdate or JOB_ENDTIME = null 
            ]]>
        < /isEqual>
        <isEqual prepend="and" property="queryPeriodOfValidity" compareValue="no">
            <![CDATA[
                JOB_ENDTIME <= sysdate or JOB_ENDTIME = null 
            ]]>
        < /isEqual>
        ORDER  BY S_SEQ_ID DESC
    </select>



出错的代码应该是在下面这段代码中,求高手给我看看是怎么回事
XML code

<isEqual prepend="and" property="queryPeriodOfValidity" compareValue="yes">
            <![CDATA[
                JOB_STATRTIME <= sysdate and JOB_ENDTIME >= sysdate or JOB_ENDTIME = null 
            ]]>
        < /isEqual>
        <isEqual prepend="and" property="queryPeriodOfValidity" compareValue="no">
            <![CDATA[
                JOB_ENDTIME <= sysdate or JOB_ENDTIME = null 
            ]]>
        < /isEqual>



报错显示为:
Java code

java.lang.RuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.


Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.


Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.


Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

Caused by: org.xml.sax.SAXParseException: The content of elements mus