Return-Path: Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 35058 invoked from network); 13 Feb 2003 21:18:57 -0000 Received: from maxout.maxwell.af.mil (132.60.7.12) by daedalus.apache.org with SMTP; 13 Feb 2003 21:18:57 -0000 Received: from vs_maxwell_03.maxwell.af.mil (vs-maxwell-03 [132.60.216.120]) by maxout.maxwell.af.mil (8.12.6/8.12.6) with SMTP id h1DLH8U1017680 for ; Thu, 13 Feb 2003 15:17:08 -0600 Received: FROM fspnqs02.maxwell.af.mil BY vs_maxwell_03.maxwell.af.mil ; Thu Feb 13 15:19:13 2003 -0600 Received: by fspnqs02.maxwell.af.mil with Internet Mail Service (5.5.2653.19) id <13SLY59H>; Thu, 13 Feb 2003 15:18:53 -0600 Message-ID: From: Jarnot Voytek Contr AU HQ/SC To: "'Turbine Torque Users List'" Subject: RE: Torque 3.0 Oracle 8i and Dates Date: Thu, 13 Feb 2003 15:18:46 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Well, I'm going to answer myself in the hopes that this helps someone else, my null pointer exception was solved by adding torque.database.default.adapter=oracle to my torque.properties file. That brought to light a whole new suite of problems with using Dates in Criteria with Oracle. After wading through the source for a while, I've fixed the problem by adding the following to org.apache.torque.adapter.DBOracle.java: private static final String DATE_FORMAT = "dd-MM-yyyy HH:mm:ss"; public String getDateString(Date date) { return "TO_DATE('" + new SimpleDateFormat(DATE_FORMAT).format(date) + "', 'DD-MM-YYYY HH24:MI:SS')"; } Essentially, since DBOracle didn't override getDateString(String), the one from DB was being used - which is completely useless as far as Oracle is concerned. Actually it's beyond buggy, because it doesn't take into account the fact that Timestamp objects cannot represent dates before 01-Jan-1970. Anyway, I think my solution should work (it works for us, so far). What is the process of forwarding this as a suggestion to the Torque developers? Torque is still being actively maintained, right? Thanks, -- Voytek Jarnot Quidquid latine dictum sit, altum viditur. > -----Original Message----- > From: Jarnot Voytek Contr AU HQ/SC > [mailto:Voytek.Jarnot@maxwell.af.mil] > Sent: Thursday, February 13, 2003 12:43 PM > To: 'Turbine Torque Users List' > Subject: RE: Torque 3.0 Oracle 8i and Dates > > > To further clarify, here's a stack trace: > > java.lang.NullPointerException > at > org.apache.torque.util.SqlExpression.build(SqlExpression.java:278) > at > org.apache.torque.util.SqlExpression.build(SqlExpression.java:205) > at > org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1846) > at > org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1772) > at > mypackage.BaseMyEntityPeer.doUpdate(BaseMyEntityPeer.java:430) > at > mypackage.BaseMyEntityPeer.doUpdate(BaseMyEntityPeer.java:404) > ... and so it goes ... > > -- > Voytek Jarnot > Quidquid latine dictum sit, altum viditur. > > > > -----Original Message----- > > From: Jarnot Voytek Contr AU HQ/SC > > [mailto:Voytek.Jarnot@maxwell.af.mil] > > Sent: Thursday, February 13, 2003 11:43 AM > > To: 'torque-user@db.apache.org' > > Subject: Torque 3.0 Oracle 8i and Dates > > > > > > I'm new to the list, so hopefully this isn't a rehash... > > > > I'm running into this bug: > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15745 , a > lot of our > > tables include date columns as part of the pk, and I can't > > wrap my head > > around the fact that that would be unsupported. I would > > appreciate any and > > all help with this issue, as this bug will make torque > unusable for us > > without a work-around. > > > > Are there any work-arounds for this problem (please say yes)? > > > > Thanks, > > -- > > Voytek Jarnot > > Quidquid latine dictum sit, altum viditur. > > > > > > > --------------------------------------------------------------------- > > 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 >