ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iba...@aladin.ca
Subject Re: isPropertyAvailable doesn't work as expected...
Date Thu, 15 Jun 2006 19:49:52 GMT
Problem solved: use <sql> and <include>.

Aladin


>
> I have two simple queries which I am trying to combine using
> <isPropertyAvailable...> but it doesn't seem to work as expected.
>
> Query 1: SELECT requestid FROM users WHERE name = 'test'
> Query 2: SELECT count(*) FROM users WHERE name = 'test'
>
> IN XML:
> =======
> <select id="getResult" resultClass="java.util.Hashtable"
> cacheModel="memory-cache">
> SELECT
> <isPropertyAvailable property="count"> count(*) </isPropertyAvailable>
> <isNotPropertyAvailable property="count"> requestid
> </isNotPropertyAvailable>
> FROM users WHERE name = 'test'
> </select>
>
> RESULT:
> =======
> [DEBUG] - Query key=getResult, params={} (getObjects)
> [DEBUG] - Query key=getResult, params={count=count} (getObjects)
> [ERROR] -
> --- The error occurred in queries.xml.
> --- The error occurred while applying a result map.
> --- Check the getResult-AutoResultMap.
> --- Check the result mapping for the 'requestid' property.
> --- Cause: org.postgresql.util.PSQLException: The column name requestid
> was not found in this ResultSet. (getObjects)
>
> I always get an error in the second query I call.  Am I missing something
> here?
>
> Thanks.
> Aladin
>


Mime
View raw message