db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: Criteria.addAscendingOrderByColumn(field) NullPointerEx
Date Tue, 20 Apr 2004 23:13:54 GMT
Daniel,

The most common cause of this problem is when the database name has not 
been specified in the schema file.  Are you doing this?

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



Daniel Kreuzhofer wrote:

>Hello Jürgen,
>
>I have the same problem and tried all the previous hints, but i still habe
>the same problem.
>Is this a bug in Torque 3.1? Is there a better solution available now?
> 
>
>  
>
>>-----Original Message-----
>>From: Jürgen Hoffmann [mailto:jh@byteaction.de] 
>>Sent: Tuesday, January 13, 2004 6:25 PM
>>To: Apache Torque Users List
>>Subject: Re: Criteria.addAscendingOrderByColumn(field) NullPointerEx
>>
>>Hi Jaya,
>>
>>before you do anything with the Criteria try the following:
>>
>>Criteria c = new Criteria();
>>c.setDbName("mydb");
>>.
>>.
>>.
>>c.addAscendingOrderByColumn(PeerClassPeer.ORDER_COLUMN);
>>
>>PeerClassPeer.doSelect(c);
>>
>>This should solve your Problem.
>>
>>kind regards
>>
>>Jürgen Hoffmann
>>
>>Jaya wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>I have added the following in torque.properties file
>>>
>>>torque.database.default=mydb
>>>torque.database.mydb.adapter=oracle
>>>
>>>where mydb is the db name.But still I am getting the same 
>>>      
>>>
>>error ,if we 
>>    
>>
>>>use addAscendingOrderByColumn() for sorting the character values.
>>>
>>>Please let me know what should be done.
>>>
>>>Thank you,
>>>Regards,
>>>Jaya.
>>>
>>>
>>>
>>>-----Original Message-----
>>>From: Gerhard Otte [mailto:Gerhard.Otte@emediapark.de]
>>>Sent: Friday, January 09, 2004 1:30 PM
>>>To: Apache Torque Users List
>>>Subject: AW: Criteria.addAscendingOrderByColumn(field) NullPointerEx
>>>
>>>
>>>torque.database.@torque.database.name@.adapter=oracle
>>>
>>>HTH
>>>Gerhard Otte
>>>__
>>>mailto:G.Otte@emediapark.de     emediapark GmbH 
>>>      
>>>
>>http://www.emediapark.de
>>    
>>
>>>Tel:+49 (0)941 630804-2 Fax:-9  Hemauerstr.14,93047 
>>>      
>>>
>>Regensburg,Germany
>>    
>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: Jaya [mailto:jaya@gft.com]
>>>Gesendet: Freitag, 9. Januar 2004 06:04
>>>An: Apache Torque Users List
>>>Betreff: RE: Criteria.addAscendingOrderByColumn(field) NullPointerEx
>>>
>>>
>>>Hello,
>>>
>>>We are also facing the same problem.
>>>
>>>Please let me know how to specify the parameter in torque.properties 
>>>for oracle database.
>>>
>>>Thank you,
>>>Regards,
>>>Jaya.
>>>
>>>
>>>
>>>-----Original Message-----
>>>From: mr.x [mailto:mr.x@tele2.ch]
>>>Sent: Thursday, December 18, 2003 1:03 AM
>>>To: 'Apache Torque Users List'
>>>Subject: RE: Criteria.addAscendingOrderByColumn(field) NullPointerEx
>>>
>>>
>>>Hello
>>>
>>>Thanks for your replies. Finally i found the problem: the parameter 
>>>"torque.database.@torque.database.name@.adapter=mysql" was missing
>>>(misspelled) in the configs. Strange behaviour ;->
>>>
>>>Anyway. Thanks for helping
>>>
>>>Cheers Rolf
>>>
>>>-----Original Message-----
>>>From: Gerhard Otte [mailto:Gerhard.Otte@emediapark.de]
>>>Sent: Dienstag, 16. Dezember 2003 11:56
>>>To: Apache Torque Users List
>>>Subject: AW: Criteria.addAscendingOrderByColumn(field) NullPointerEx
>>>
>>>
>>>Hello Rolf
>>>
>>>I faced the same problem here - NullPOinter Exception when using 
>>>addAscendingOrderByColumn(). After putting the line 
>>>torque.database.LVS.adapter=mssql (where LVS is the Name of 
>>>      
>>>
>>my database 
>>    
>>
>>>using SQL Server) into my configuration file the problem 
>>>      
>>>
>>didn't come up 
>>    
>>
>>>again.
>>>
>>>I think it has to do with database naming. Kind of magic.
>>>
>>>Bye
>>>Gerhard Otte
>>>__
>>>mailto:G.Otte@emediapark.de     emediapark GmbH 
>>>      
>>>
>>http://www.emediapark.de
>>    
>>
>>>Tel:+49 (0)941 630804-2 Fax:-9  Hemauerstr.14,93047 
>>>      
>>>
>>Regensburg,Germany
>>    
>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: mr.x [mailto:mr.x@tele2.ch]
>>>Gesendet: Montag, 15. Dezember 2003 20:49
>>>An: torque-user@db.apache.org
>>>Betreff: Criteria.addAscendingOrderByColumn(field) NullPointerEx
>>>
>>>
>>>Hello all
>>>
>>>I'm currently developing my first "torque based" java-app. (Almost) 
>>>everything works fine; but if i use 
>>>      
>>>
>>addAscendingOrderByColumn() with a 
>>    
>>
>>>character field or use setLimit() on a Criteria object i get a
>>>NullPointerException:
>>>java.lang.NullPointerException
>>>       at
>>>org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1277)
>>>       at
>>>org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:984)
>>>       at 
>>>      
>>>
>>org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1391)
>>    
>>
>>>       at 
>>>      
>>>
>>org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1368)
>>    
>>
>>>(Sample=addAscendingOrderByColumn)
>>>
>>>I'm using torque 3.1 on winxp with mysql 4.0.15
>>>
>>>Is this a torque "feature" or a "config issue" ? Is it 
>>>      
>>>
>>possible to sort 
>>    
>>
>>>and or limit the result set in another way ? (... groupBy 
>>>      
>>>
>>works i know 
>>    
>>
>>>-> thats not sorting ;->)
>>>
>>>Thanks for help
>>>
>>>Regards
>>>
>>>Rolf
>>>      
>>>



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message