From torque-user-return-4651-apmail-db-torque-user-archive=db.apache.org@db.apache.org Wed Apr 14 10:14:52 2004 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 48021 invoked from network); 14 Apr 2004 10:14:52 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 14 Apr 2004 10:14:52 -0000 Received: (qmail 93757 invoked by uid 500); 14 Apr 2004 10:14:22 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 93684 invoked by uid 500); 14 Apr 2004 10:14:21 -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: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 93660 invoked from network); 14 Apr 2004 10:14:20 -0000 Received: from unknown (HELO msgdirector1.onetel.net.uk) (212.67.96.148) by daedalus.apache.org with SMTP; 14 Apr 2004 10:14:20 -0000 Received: from bolek.coachhouse (213-78-111-57.friaco.onetel.net.uk [213.78.111.57]) by msgdirector1.onetel.net.uk (Mirapoint Messaging Server MOS 3.3.6-GR) with ESMTP id BEQ84970; Wed, 14 Apr 2004 11:14:31 +0100 (BST) Received: (Exim 3.35) #1 (Debian)) protocol: esmtp id 1BDhO0-0004Ou-00 ; Wed, 14 Apr 2004 11:12:52 +0100 Message-ID: <407D0EA4.3080804@numerixtechnology.de> Date: Wed, 14 Apr 2004 11:12:52 +0100 From: T E Schmitz Reply-To: mail@numerixtechnology.de User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: PostgreSQL TIMESTAMP comparison fails References: <407C1802.9070000@numerixtechnology.de> In-Reply-To: <407C1802.9070000@numerixtechnology.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, Just to prevent other people from falling into the same trap, here's what caused the TIMESTAMP comparison to fail: When updating the record I had provided the setter method setTimestamp in BaseXxx.java with a java.util.Date. This was with hindsight maybe rather stupid but I did that because I saw the BaseXxx class declare it as java.util.Date. When fetched from the database, somewhere in the Torque runtime the timestamp is declared as java.sql.Timestamp which is a subclass of java.util.Date and as such adds nanosecond precision. While setting the TIMESTAMP column with a java.util.Date is syntactically correct, it causes later comparisons to fail. I am still not quite sure where I could / should have seen that a java.sql.Timestamp was required to handle TIMESTAMP columns. Question to the Torque developers: would it not be wiser to declare timestamps as java.sql.Timestamp in the generated code? Best Regards, Tarlika Elisabeth Schmitz >> doDelete does not delete the record as the following WHERE clause >> returns no results: --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org