Return-Path: Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 23586 invoked by uid 500); 10 Jul 2003 16:11:00 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Turbine Torque Users List" Reply-To: "Turbine Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 23433 invoked from network); 10 Jul 2003 16:10:57 -0000 Received: from sam.hotapp.com (HELO sam.bka-inc.com) (12.145.73.6) by daedalus.apache.org with SMTP; 10 Jul 2003 16:10:57 -0000 Received: from sleipnir (users.springfield.bka-inc.com [12.145.79.23]) by sam.bka-inc.com (8.12.8/8.12.8) with ESMTP id h6AGDrXR032282 for ; Thu, 10 Jul 2003 12:14:02 -0400 Reply-To: From: "Tim Clotworthy" To: "'Turbine Torque Users List'" Subject: RE: Criteria.addAscendingOrderByColumn() bug? (DB IS NULL) Date: Thu, 10 Jul 2003 12:10:53 -0400 Organization: BKA Message-ID: <000d01c346fd$d96c27c0$3201a8c0@sleipnir> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <3F0C847E.32510.35AC0366@localhost> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N As a test, I just attempted to register the mapbuilder before my doSelect() as described below, and I got an exception at the point of the registration call. My code was: Torque.registerMapBuilder("com.hotapp.fes.om.map.RefTransactionCodesMapB uilder"); transList = (ArrayList) RefTransactionCodesPeer.doSelect(crit); and the exception was: java.lang.NullPointerException at org.apache.torque.Torque.registerMapBuilder(Torque.java:821) at com.hotapp.fes.support.FESSupportDAO.selectTransTypes(FESSupportDAO.j ava:204) at com.hotapp.fes.support.FESSupportManager.selectTransTypes(FESSupportM anager.java:112)..blah..blah.. The corresponding Torque.java line is: public static void registerMapBuilder(String className) { (here's line 821): mapBuilders.add(className); } As I am passing a String, don't see how that could be the problem, and since mapBuilders object would presumably get created at time method is called (since both method call and mapBuilders object are static.. What might I be doing wrong?? Thanks again ahead of time. > -----Original Message----- > From: Brian K. Wallace [mailto:brian@transmorphix.com] > Sent: Wednesday, July 09, 2003 10:09 PM > To: Turbine Torque Users List > Subject: RE: Criteria.addAscendingOrderByColumn() bug? (DB IS NULL) > > I have what I view as a hack of a workaround, but if you register the map > builders > prior to issuing your DB calls, you should be fine. I've had to do this > not only for > ordering, but also for duplicating objects for separate but identical > databases (gen > Torque code for db "x" and then use all the code for DbName='y'). > > [Torque.registerMapBuilder("com.mycompany.om.map.MyObjectMapBuilder");] > > On 9 Jul 2003 at 18:08, Geoff Fortytwo wrote: > > > I'm having the problem as well. People have asked about this on this > list a > > number of times, but no one seems to have an answer. The problem lies > with > > using a string column for ordering vs any other column type. Try > ordering > > with any other column which is not a string column. I'll bet it works. > > > > In the source code of BasePeer, it appears that the "db" variable is > null. > > That variable is only referred to if the order by column is a string, so > > that's why there's a problem only when using string columns to order by. > > > > The value of db is set higher up in the function with: > > DB db = Torque.getDB(criteria.getDbName()); > > > > So for some reason Torque.getDB is returning null. > > > > I've tried creating the Criteria using: > > Criteria crit = new Criteria(); > > or > > Criteria crit = new Criteria("rego"); > > where "rego" is my database name. > > > > I've tried calling > > crit.setDbName("rego"); > > > > In my schema file I have the element > > > > > > But none of those things makes any difference. > > > > Can anyone help? Does anyone know how to fix this? > > > > > > At 01:50 PM 7/9/2003, Tim Clotworthy wrote: > > >Thanks for the reply. Did you ever resolve this, and if so, could you > > >tell me how? I am using Oracle9i database, and torque3.0. Thanks > again. > > > > > > > -----Original Message----- > > > > From: Duddikunta, Padmanabha [mailto:Pkd2@cdc.gov] > > > > Sent: Wednesday, July 09, 2003 4:32 PM > > > > To: 'Turbine Torque Users List' > > > > Subject: RE: Criteria.addAscendingOrderByColumn() bug? > > > > > > > > I have encountered same NullPointerException when ordering by > > >ascending as > > > > well as descending. > > > > > > > > Paddy > > > > > > > > > > > > -----Original Message----- > > > > From: Tim Clotworthy [mailto:tclotworthy@bka-inc.com] > > > > Sent: Wednesday, July 09, 2003 4:22 PM > > > > To: Torque-User@Db. Apache. Org > > > > Subject: Criteria.addAscendingOrderByColumn() bug? > > > > > > > > Hello, > > > > I was hoping some could tell me whether there are any know bugs with > > >the > > > > > > > > org.apache.torque.util.Criteria. addAscendingOrderByColumn() method? > > > > I have a very simple query: > > > > > > > > FESCriteria crit = new FESCriteria(); > > > > > > > >crit.addAscendingOrderByColumn(RefTransactionCodesPeer.TYPE_OF_TRANSACT I > > > > ON); > > > > > > > > transList = (ArrayList) RefTransactionCodesPeer.doSelect(crit); > > > > > > > > If I leave out the addAscendingOrderByColumn line, it works fine. > When > > > > included, > > > > I get an exception: > > > > > > > > java.lang.NullPointerException > > > > at > > > > org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1209) > > > > at > > > > org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:927) > > > > at > > >org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1321) > > > > at > > > > > com.hotapp.fes.om.BaseRefTransactionCodesPeer.doSelectVillageRecords( > > > > BaseRefTransactionCodesPeer.java:398) > > > > at > > > > > com.hotapp.fes.om.BaseRefTransactionCodesPeer.doSelectVillageRecords( > > > > BaseRefTransactionCodesPeer.java:366) > > > > at > > > > > com.hotapp.fes.om.BaseRefTransactionCodesPeer.doSelect(BaseRefTransac > > > > tionCodesPeer.java:334) > > > > at > > > > > com.hotapp.fes.support.FESSupportDAO.selectTransTypes(FESSupportDAO.j > > > > ava:202)...blah, blah, blah.. > > > > > > > > I have verified that the RefTransactionCodesPeer.TYPE_OF_TRANSACTION > > >is > > > > equivalent to a valid and appropriate String value, so its not that. > > > > > > > > Any ideas would be greatly appreciated. Thanks. > > > > > > > > > > > > > > > > -------------------------------------------------------------------- > - > > > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > > > For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > > > > > > >--------------------------------------------------------------------- > > >To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > >For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org