You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by radha rukmani <ra...@yahoo.com> on 2006/01/09 16:35:15 UTC
parameter map
Hi
I am trying to pass some parameters into the select statement.
My select statement in ibatis, is like this.
<select id="getTransferPendingPlates" parameterClass="java.util.Map" resultClass="java.util.List">
SELECT
GBL_PLATE_BAR_CODE
FROM GTN_FERT_PLATE
WHERE LOCATION_STATUS=#locationStatus#
AND
TRANSFER_STATUS=#transferStatus#
</select>
And i am calling this from the java class, like this.
parameterMap.put("transferStatus",TRANSFER_STATUS_PENDING);
parameterMap.put("locationStatus",LOCATION_STATUS_PERMANENT);
try{
pendingPlates = (List)sqlMap.queryForList("getTransferPendingPlates",parameterMap);
}catch(Exception e)
Now my pendingPlates list shows an empty list of strings. but if i run the same query in oracle, i get some result. What am i doing wrong. Could any one please help
Thanks.
---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
Re: parameter map
Posted by Ben Munat <be...@munat.com>.
radha rukmani wrote:
> Hi Siddiqi,
>
> I still get the same behaviour, even when I left it as defaults.
>
> How could i know what is the generated sql out of ibatis, is there a way
> to print out what sql it executed.
>
If you're using logging, set the logging level for java.sql to DEBUG and you'll get all
the queries, parameters, and results in your log.
b
Re: parameter map
Posted by radha rukmani <ra...@yahoo.com>.
Hi Siddiqi,
I still get the same behaviour, even when I left it as defaults.
How could i know what is the generated sql out of ibatis, is there a way to print out what sql it executed.
Thanks,
Zarar Siddiqi <za...@utoronto.ca> wrote:
It might be because java.util.Map and java.util.List are interfaces and not classes. I think the defaults in this case will work fine (aka: don't specify anything). You can also use java.util.HashMap as the parameter class.
----- Original Message -----
From: radha rukmani
To: user-java@ibatis.apache.org
Sent: Monday, January 09, 2006 10:35 AM
Subject: parameter map
Hi
I am trying to pass some parameters into the select statement.
My select statement in ibatis, is like this.
<select id="getTransferPendingPlates" parameterClass="java.util.Map" resultClass="java.util.List">
SELECT
GBL_PLATE_BAR_CODE
FROM GTN_FERT_PLATE
WHERE LOCATION_STATUS=#locationStatus#
AND
TRANSFER_STATUS=#transferStatus#
</select>
And i am calling this from the java class, like this.
parameterMap.put("transferStatus",TRANSFER_STATUS_PENDING);
parameterMap.put("locationStatus",LOCATION_STATUS_PERMANENT);
try{
pendingPlates = (List)sqlMap.queryForList("getTransferPendingPlates",parameterMap);
}catch(Exception e)
Now my pendingPlates list shows an empty list of strings. but if i run the same query in oracle, i get some result. What am i doing wrong. Could any one please help
Thanks.
---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
---------------------------------
Yahoo! Photos Showcase holiday pictures in hardcover
Photo Books. You design it and well bind it!
Re: parameter map
Posted by Zarar Siddiqi <za...@utoronto.ca>.
It might be because java.util.Map and java.util.List are interfaces and not classes. I think the defaults in this case will work fine (aka: don't specify anything). You can also use java.util.HashMap as the parameter class.
----- Original Message -----
From: radha rukmani
To: user-java@ibatis.apache.org
Sent: Monday, January 09, 2006 10:35 AM
Subject: parameter map
Hi
I am trying to pass some parameters into the select statement.
My select statement in ibatis, is like this.
<select id="getTransferPendingPlates" parameterClass="java.util.Map" resultClass="java.util.List">
SELECT
GBL_PLATE_BAR_CODE
FROM GTN_FERT_PLATE
WHERE LOCATION_STATUS=#locationStatus#
AND
TRANSFER_STATUS=#transferStatus#
</select>
And i am calling this from the java class, like this.
parameterMap.put("transferStatus",TRANSFER_STATUS_PENDING);
parameterMap.put("locationStatus",LOCATION_STATUS_PERMANENT);
try{
pendingPlates = (List)sqlMap.queryForList("getTransferPendingPlates",parameterMap);
}catch(Exception e)
Now my pendingPlates list shows an empty list of strings. but if i run the same query in oracle, i get some result. What am i doing wrong. Could any one please help
Thanks.
------------------------------------------------------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.