Heres the code which results in Null Pointer Exception
criteria=new Criteria();
criteria.add(EmpPeer.ENAME,(Object)eName,Criteria.LIKE);
criteria.getCriterion(EmpPeer.ENAME).setIgnoreCase(true);
List list=EmpPeer.doSelect(criteria);
I get the exception in the last line of the code.
Is anything to be modified?
Thanks and Regards
Ramah
-----Original Message-----
From: Scott Eade [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 6:05 PM
To: Apache Torque Users List
Subject: Re: Using Upper and Lower functions in Criteria
Please post the code that builds the criteria that resulted in the NPE.
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
Ramah wrote:
>When I tried,
>
>criteria.getCriterion(YourPeerPeer.ENAME).setIgnoreCase(true);
>
>The following exception occurs.
>
>
>java.lang.NullPointerException
> at org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1066)
> at org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:927)
> ...
>
>Thanks and Regards,
>Ramah
>
>
>
>-----Original Message-----
>From: Scott Eade [mailto:[EMAIL PROTECTED]
>Sent: Saturday, December 20, 2003 7:34 AM
>To: Apache Torque Users List
>Subject: Re: Using Upper and Lower functions in Criteria
>
>
>Ramah wrote:
>
>
>
>>Is there any possibility to use UPPER and LOWER function of SQL in
>>Criteria?
>>
>>*Ex: Select eid from employee where upper(ename)='XYZ'.
>>How to create Criteria for the above Query?*
>>
>>
>>
>
>try:
>
> criteria.getCriterion(YourPeerPeer.ENAME).setIgnoreCase(true);
>
>Scott
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]