Java Mailing List Archive

http://www.java2.5341.com/

Home » user-java.ibatis »

WHERE clause with full parameter condition send

Betto McRose Gamarra

2008-11-21

Replies: Find Java Web Hosting

Author LoginPost Reply
hi,

well, I have a problem when I send the whole condition for the WHERE clause

this is the xml config:

  <select id="getSqlResult" resultClass="java.util.Map"
parameterClass="java.util.Map">
    <![CDATA[
       SELECT
          ID,
          $columName$ AS DESCRIPTION

       FROM
          $tableName$
    ]]>
       <dynamic prepend="WHERE">
        <isNotNull prepend="WHERE" property="condition">
           #condition#
        </isNotNull>
       </dynamic>
  </select>

every property has a value, I could check that

the problem is because I don't have condition= #condition#
and I get this error:
ERROR [STDERR] com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the Ref.getSqlResult-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00920: invalid relational operator



I checked the sql string before calling to sqlExecuteQuery() method in
MappedStatement class
this is the result:

SELECT ID, DOC_NAME AS DESCRIPTION FROM DOCUMENT WHERE ?

as you can see, the only missing part is the where clause I send

the value in the HashMap is filled, I also check that

what is the solution for this ?

--
Betto McRose Gamarra
IcarusDB
"Soluciones Informáticas"
Cel.: +595 992 686947
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.