ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <larry.mead...@gmail.com>
Subject Re: Multiple Parameters
Date Mon, 20 Oct 2008 12:05:59 GMT
If you're using log4j, set java.sql to DEBUG - that should show you
the sql, the parameters, and the results.

Larry


On Mon, Oct 20, 2008 at 4:56 AM, Bruno Frascino <BFrascino@smsmt.com> wrote:
>  I know... it seems to be right that's why is so strange!
>  The letter 'o' is an alias for the table.. it is ok.
>  I don't get any exception, but my query doesn't return anything, only when
> I pass only one parameter and hardcode the ohter, it does. And I test this
> query on my database and it works fine.
>  Do you know any configuration that could affect this behaviour of passing
> multiple parameters?
>
>  If I could see the query IBATIS is trying to run, maybe I could have a clue
> of what is happening... how can I see it?
>
>  Thanks and regards!
>
>
>
>
> Bruno Frascino
>
> ________________________________
> From: Vadim [deadmoro3@gmail.com]
> Sent: Monday, 20 October 2008 5:49 PM
> To: user-java@ibatis.apache.org
> Subject: Re: Multiple Parameters
>
> I don't see anything wrong, except 'FROM ATABLE o' in your query, but that's
> probably a typo, because you would have got an exception by now. Also, you
> are searching by ID's - maybe queryForObject is more appropriate in this
> case (just a guess)?
> Have you tried logging database calls? Do the right parameters get passed?
>
> On Mon, Oct 20, 2008 at 7:25 AM, Bruno Frascino <BFrascino@smsmt.com> wrote:
>>
>>  Hello,
>>
>>  I have got:
>>
>>
>> <resultMap id="basicUserDetails"class="mypack.domain.BasicUserDetails">
>>
>>  <result property="user" column="user" />
>>
>>  <result property="employeeId" column="employee_id" />
>>
>>  <result property="profileLogin" column="PROFILE_LOGIN" />
>>
>> </resultMap>
>>
>>
>> <select id="findIt" parameterClass="java.util.Map"
>> resultMap="basicUserDetails">
>>
>> <![CDATA[
>>
>> SELECT
>>
>> o.user,
>>
>> o.employee_id,
>>
>> o.profile_login
>>
>> FROM ATABLE o
>>
>> WHERE
>>
>> o.user = #userId#
>>
>> AND
>>
>> o.employee_id = #employeeId#
>>
>> ]]>
>>
>> </select>
>>
>>
>> then my DAO does:
>>
>>
>> Map paramM =
>>
>> new HashMap();
>>
>> paramM.put(
>>
>> "userId", userId);
>>
>> paramM.put(
>>
>> "employeeId", employeeId);
>>
>>
>>
>> users = (List)
>>
>> this.getSqlMapClientTemplate().queryForList("findIt", paramM);
>>
>>
>> My users list is not null, I don't get any error doing this call but it
>> returns an empty list.
>> If I hardcode my query then I get my records...
>>
>> Any help please!?
>>
>>  Cheers!
>>
>>
>>
>> Bruno Frascino
>>
>> ________________________________
>> NOTICE - This communication is intended only for the person or entity to
>> which it is addressed and may contain confidential and/or privileged
>> material. Any review, retransmission, dissemination or other use of, or
>> taking any action in reliance on, this communication by persons or entities
>> other than the intended recipient is prohibited. If you are not the intended
>> recipient of this communication please delete and destroy all copies and
>> telephone SMS Management & Technology on 9696 0911 immediately. Any views
>> expressed in this Communication are those of the individual sender, except
>> where the sender specifically states them to be the views of SMS Management
>> & Technology. Except as required by law, SMS Management & Technology does
>> not represent, warrant and/or guarantee that the integrity of this
>> communication has been maintained nor that the communication is free from
>> errors, virus, interception or interference.
>
>
> ________________________________
> NOTICE - This communication is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking any action in reliance on, this communication by persons or entities
> other than the intended recipient is prohibited. If you are not the intended
> recipient of this communication please delete and destroy all copies and
> telephone SMS Management & Technology on 9696 0911 immediately. Any views
> expressed in this Communication are those of the individual sender, except
> where the sender specifically states them to be the views of SMS Management
> & Technology. Except as required by law, SMS Management & Technology does
> not represent, warrant and/or guarantee that the integrity of this
> communication has been maintained nor that the communication is free from
> errors, virus, interception or interference.
>

Mime
View raw message