ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: isPropertyAvailable doesn't work as expected...
Date Thu, 15 Jun 2006 19:52:21 GMT
You'll have to do remapResults="true" in this case - because you are
changing the result set in the same query.

Jeff Butler


On 6/15/06, ibatis@aladin.ca <ibatis@aladin.ca> wrote:
>
> Hello,
>
> 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