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 jeremy jardin <je...@newtec.caisse-epargne.fr> on 2006/07/13 10:38:55 UTC

RE : RE : RE : RE : RE : request using beanExample

I think that I'am understanding the matter with my request.

I precise one more time that my xml and dao files have been generated using Abator.

So I want to launch a request with a where clause on "MOBILE" property.
When I look on the XML file, I just can't see that :

<sql id="abatorgenerated_Example_Where_Clause">
    <!--
      WARNING - This element is automatically generated by Abator for iBATIS, do not modify.
    -->
    <dynamic prepend="where">
    <isPropertyAvailable prepend="and" property="AND_CLIENT_UUID_EQUALS">
        CLIENT_UUID = #CLIENT_UUID#
      </isPropertyAvailable>
  
	etc..

And in those 'isPropertyAvailable' tags, I can't find 'MOBILE' property.
Maybe that's why my requests using MOBILE where clause do not work ! ??

Sould I had the property ??

Thx


-----Message d'origine-----
De : Yusuf [mailto:Yusuf@ekalife.co.id] 
Envoyé : mercredi 12 juillet 2006 11:15
À : user-java@ibatis.apache.org
Objet : RE: RE : RE : RE : RE : request using beanExample

i had this kind of problem and solved using right padding with empty
space, eg.

Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, ETAT_MODIFIE,TSTMPINSR,
TSTMPUPDT  from UTILISATEUR where MOBILE = rpad(#value#,12,' ')

Regards,
Yusuf

-----Original Message-----
From: jeremy jardin [mailto:jeremy.jardin@newtec.caisse-epargne.fr]
Sent: Wednesday, July 12, 2006 4:13 PM
To: user-java@ibatis.apache.org; lmeadors@apache.org
Subject: RE : RE : RE : RE : request using beanExample


I'm still having that pb.. even if I only insert 12CHAR long Strings !!

I insert my user with un phone Number like that "060000000000  "
(12 chars)

and in my request, I set my example witth thaht number : "060000000000
"

stil no results !! :-(



-----Message d'origine-----
De : larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] De la part
de Larry Meadors
Envoyé : mercredi 12 juillet 2006 10:49
À : user-java@ibatis.apache.org
Objet : Re: RE : RE : RE : request using beanExample

Yep.

On 7/11/06, jeremy jardin <je...@newtec.caisse-epargne.fr>
wrote:
> You mean that is my fiel dis CHAR(12)... and the string I put in is
only 8 char long;. It could be problematic ?
>
>
>
> -----Message d'origine-----
> De: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] De la
part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 10:37
> À: user-java@ibatis.apache.org
> Objet: Re: RE : RE : request using beanExample
>
> The length is probably wrong, and in all SQL dialects I have ever
> used, "  A"  does not equal "A".
>
> Larry
>
>
> On 7/11/06, jeremy jardin <je...@newtec.caisse-epargne.fr>
wrote:
> > A CHAR !!
> > Why ??
> >
> >
> > -----Message d'origine-----
> > De: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] De la
part de Larry Meadors
> > Envoyé: mercredi 12 juillet 2006 09:50
> > À: user-java@ibatis.apache.org
> > Objet: Re: RE : request using beanExample
> >
> > Is MOBILE a CHAR field or VARCHAR?
> >
> > Larry
> >
> >
> > On 7/11/06, jeremy jardin <je...@newtec.caisse-epargne.fr>
wrote:
> > > All my classes have been generated using Abator so, I have
something like that :
> > >
> > > List list =
sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample",
parms);
> > >
> > > Parms contains my where clause, instanciated the good way...
> > >
> > > PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN,
ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> > > Parameters: [0613410836]
> > > Types: [java.lang.String]
> > > ResultSet
> > >
> > >
> > > What's the matter with my request ?
> > >
> > >
> > > -----Message d'origine-----
> > > De: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] De la
part de Larry Meadors
> > > Envoyé: mercredi 12 juillet 2006 09:39
> > > À: user-java@ibatis.apache.org
> > > Objet: Re: request using beanExample
> > >
> > > Do you have a resultMap or resultClass for the select?
> > >
> > > Larry
> > >
> > >
> > > On 7/11/06, jeremy jardin <je...@newtec.caisse-epargne.fr>
wrote:
> > > >
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > >
> > > >
> > > > I'm trying to launch a request using a beanExample .. I've
logged the sql
> > > > request, and I can see that this request should answers 1
result.
> > > >
> > > >
> > > >
> > > > After all. my resultList is empty, and I don't know why.
> > > >
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > >
> > >
> >
>

Re: RE : RE : RE : RE : RE : request using beanExample

Posted by Jeff Butler <je...@gmail.com>.
Yes - this is the correct way to do it.  Set the value for the MOBILE field,
as well as the indicator for the field.

Jeremy - it looks, from your previous posts, that the SQL statement is being
generated correctly.  Can you run the generated SQL statement (from the
logs) in an SQL client to verify?

As for looking at the generated XML, the generated XML for the where clause
is very wordy and too complex (because of a bug in the current version of
iBATIS).  To see how it works, you'll have to look at the code in the
generated DAO.

All I can offer is that the bug in iBATIS is fixed and when iBATIS 2.2.0 is
released, there will be a better version of Abator available.  The generated
XML and DAO classes are MUCH (orders of magnitude) smaller.

Jeff Butler



On 7/13/06, Graeme J Sweeney <ib...@gjsweeney.com> wrote:
>
> On Thu, 13 Jul 2006, jeremy jardin wrote:
>
> > So I want to launch a request with a where clause on "MOBILE" property.
> > When I look on the XML file, I just can't see that :
>
> <snip/>
>
> > Sould I had the property ??
>
> Pour votre Anglais: add not had
>
> From your abator generated classes you should have a
> UTILISATEURExample (or UtilsateurExample) source file. It should have a
> method
>
> setMobile_Indicator()
>
> such that
>
> UTILISATEURExample.setMobile("060000000000  ");
> UTILISATEURExample.setMobile_Indicator(UTILISATEURExample.EXAMPLE_EQUALS);
>
> should produce the SQL you expect:
>
> select * from UTILISATEUR where MOBILE = "060000000000  ";
>
> --
> Graeme -
>

Re: RE : RE : RE : RE : RE : request using beanExample

Posted by Graeme J Sweeney <ib...@gjsweeney.com>.
On Thu, 13 Jul 2006, jeremy jardin wrote:

> So I want to launch a request with a where clause on "MOBILE" property.
> When I look on the XML file, I just can't see that :

<snip/>

> Sould I had the property ??

Pour votre Anglais: add not had

>From your abator generated classes you should have a 
UTILISATEURExample (or UtilsateurExample) source file. It should have a 
method

setMobile_Indicator()

such that

UTILISATEURExample.setMobile("060000000000  ");
UTILISATEURExample.setMobile_Indicator(UTILISATEURExample.EXAMPLE_EQUALS);

should produce the SQL you expect:

select * from UTILISATEUR where MOBILE = "060000000000  ";

-- 
Graeme -