Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 36439 invoked from network); 19 Apr 2005 22:51:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Apr 2005 22:51:22 -0000 Received: (qmail 31458 invoked by uid 500); 19 Apr 2005 22:51:21 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 31436 invoked by uid 500); 19 Apr 2005 22:51:21 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 31423 invoked by uid 99); 19 Apr 2005 22:51:21 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of brandon.goodin@gmail.com designates 64.233.170.195 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.195) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 19 Apr 2005 15:51:19 -0700 Received: by rproxy.gmail.com with SMTP id c16so75420rne for ; Tue, 19 Apr 2005 15:51:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AuESoUIIbge9dMnhbSxHAuxaPg2oB8zHpuRolT5zOF+22xo/5SScPPSgxL386dgUKv20RMxQe3qMDbdtDZHkEgTrdEye5aLGC4K9rJTxomdW0VlmtM8R1PRqUeCyzIG8+cqDiPwQisqW2TXJb0oDdULyEXdp1v4VV8UKin5uvkg= Received: by 10.38.125.45 with SMTP id x45mr325586rnc; Tue, 19 Apr 2005 15:51:18 -0700 (PDT) Received: by 10.38.74.62 with HTTP; Tue, 19 Apr 2005 15:51:18 -0700 (PDT) Message-ID: <2fe5ef5b050419155146535f8@mail.gmail.com> Date: Tue, 19 Apr 2005 16:51:18 -0600 From: Brandon Goodin Reply-To: Brandon Goodin To: iBATIS mailing list Subject: Problem with primitive parameters In-Reply-To: <2fe5ef5b0504191550587692a0@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <8193790e0504190423208f7c03@mail.gmail.com> <2fe5ef5b050419151637796092@mail.gmail.com> <8193790e050419151713eb673f@mail.gmail.com> <2fe5ef5b05041915303a324752@mail.gmail.com> <8193790e05041915418293fb9@mail.gmail.com> <2fe5ef5b0504191550587692a0@mail.gmail.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The conversation got moved off the list. Thought i'd put it back on. ---------- Forwarded message ---------- From: Brandon Goodin Date: Apr 19, 2005 4:50 PM Subject: Re: Problem with primitive parameters To: Tom Cassimon I'll run the tests against JDK 1.5 tonight and see what we com up with. Brandon On 4/19/05, Tom Cassimon wrote: > I've allready tried that, it gives no errors but returns null instead > of a JavaBean. > I know for sure the SQL statement should return valid data, but it > doesn't with the string property, if i use the user_id it does work. > He seems to have a problem with strings. I can't figure it out. > > Regards, > > Tom Cassimon > > On 4/20/05, Brandon Goodin wrote: > > You are specifying a resultClass and a resultMap. You should only > > define one or the other. As far as passing in primitives. you should > > be able to use the #value# syntax withouth issue. The default type > > aliases are as such and are case sensitive. To specify this as a > > parameter type you would use parameterClass=3D"int" etc... > > > > string > > byte > > long > > short > > int > > integer > > double > > float > > boolean > > date > > decimal > > object > > map > > hashmap > > list > > arraylist > > collection > > iterator > > > > Brandon > > > > On 4/19/05, Tom Cassimon wrote: > > > Okay, > > > > > > i'll put it there, meanwhile is there anybody who can think of some > > > fix to get around this problem ? > > > > > > On 4/20/05, Brandon Goodin wrote: > > > > I'd hate to see this get lost. Can you place this into JIRA? We can > > > > track it more fully there. This is most likely related to JDK 1.5 a= nd > > > > ibatis compatibility. We have not yet addressed compatibilities. > > > > > > > > Thanks, > > > > Brandon > > > > > > > > On 4/19/05, Tom Cassimon wrote: > > > > > Hi, > > > > > > > > > > i'm currently working on a web application that uses iBATIS in Ja= va ( > > > > > JDK 1.5 ), but i ran into a problem and tried to fix it in a litt= le > > > > > test application, but no succes. > > > > > > > > > > The first problem is that the attribute parameter, to use primiti= ve > > > > > parameters ( according to the developer guide ), is not included = in > > > > > the dtd ( http://www.ibatis.com/dtd/sql-map-2.dtd ). So i surfed = the > > > > > internet and found examples where they used primitive parameters = and > > > > > they didn't use any of the parameter attributes. But that doesn't= work > > > > > either. I've also tried parameterClass=3D"string" with no succes. > > > > > > > > > > I've also played with the database types, first it were VARCHAR2'= s now > > > > > it are CHAR's, the db is an Oracle 9.2.0.4 btw. Now i have an sql > > > > > query with a where clause that compares a string as you can see i= n > > > > > User.xml but i also tried with the user_id and then the sql query > > > > > returns an result. If i use the Name in het where clause like it = is > > > > > now, it returns null. Does anybody has any idea why ? > > > > > > > > > > Db Table: > > > > > > > > > > Create table Users ( > > > > > User_id numeric[10] primary key, > > > > > Name Char[100] unique, > > > > > Password Char[100] ); > > > > > > > > > > My sqlMapConfig.xml: > > > > > > > > > > > > > > > > > > > PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" > > > > > "http://www.ibatis.com/dtd/sql-map-config-2.dtd"> > > > > > > > > > > > > > > > > > > > > > > > > cacheModelsEnabled=3D"false" > > > > > maxRequests=3D"32" > > > > > maxSessions=3D"10" > > > > > maxTransactions=3D"5" > > > > > /> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > value=3D"jdbc:oracle:thin:@localh= ost:1521:virodb"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > My User.xml: > > > > > > > > > > > > > > > > > > > PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" > > > > > "http://www.ibatis.com/dtd/sql-map-2.dtd"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > column=3D"NAME" javaType=3D"string" = jdbcType=3D"CHAR[100]"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > My Java file: > > > > > > > > > > reader =3D Resources.getResourceAsReader("db/sql/= sqlmap/SqlMapConfig.xml"); > > > > > sqlMap =3D SqlMapClientBuilder.buildSqlMapClient(= reader); > > > > > user =3D (User) sqlMap.queryForObject("getUserbyN= ame",username); > > > > > if ( password !=3D user.getPassword() ) <-- Nullp= ointerException ( so > > > > > the previous line returns null ) > > > > > { > > > > > throw new Exception(); > > > > > } > > > > > > > > > > > > > > >