Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 84193 invoked from network); 2 May 2008 04:13:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 May 2008 04:13:31 -0000 Received: (qmail 97937 invoked by uid 500); 2 May 2008 04:13:32 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 97921 invoked by uid 500); 2 May 2008 04:13:32 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 97909 invoked by uid 99); 2 May 2008 04:13:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 21:13:32 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.206.204.120] (HELO bund.com.au) (203.206.204.120) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2008 04:12:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by bund.com.au (Postfix) with ESMTP id 0504A12620 for ; Fri, 2 May 2008 14:12:44 +1000 (EST) Received: from bund.com.au ([127.0.0.1]) by localhost (wire.bund.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25757-02 for ; Fri, 2 May 2008 14:12:35 +1000 (EST) Received: from [192.168.1.122] (mel-gw.fluencyfinancial.com [203.217.28.148]) by bund.com.au (Postfix) with ESMTP id 137DF16389 for ; Fri, 2 May 2008 14:12:35 +1000 (EST) Message-Id: <6FC0ED66-D984-4375-8055-C0BD553BA12E@bund.com.au> From: Drew Lethbridge To: users@openjpa.apache.org In-Reply-To: <920CD2321EC1234CAE675A6020A249118175D8@301081ANEX2.global.avaya.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: java.util.Data mapping to abstime (deprecated) in postgres Date: Fri, 2 May 2008 14:12:34 +1000 References: <920CD2321EC1234CAE675A6020A249118175D8@301081ANEX2.global.avaya.com> X-Mailer: Apple Mail (2.919.2) X-Virus-Scanned: Debian amavisd-new at bund.com.au X-Virus-Checked: Checked by ClamAV on apache.org Hi Daniel. I also had your problem and fixed it by implementing my own DBDictionary (subclass of PostgresDictionary) and plugging it in using the kodo.jdbc.DBDictionary configuration setting... Below is an sample of my dbdictionary which might be helpful... cheers! .droo. public class MyPostgresDictionary extends PostgresDictionary { private static final String TIMESTAMPTYPENAME = "timestamp"; /** * return the Database type for the given Java type. * When using postgres 8, map java.util.Date type to postgres TIMESTAMP column type, * instead of the Kodo PostgresDictionary default, which is ABSTIME. ABSTIME cannot * represent dates beyond 19/01/2038. if the type parameter does not specify a a Date, * then the default PostgresDictionary behaviour applies. */ @Override public String getTypeName(int type) { if (type == Types.TIMESTAMP) { return TIMESTAMPTYPENAME; } else { return super.getTypeName(type); } } //... } On 02/05/2008, at 1:56 PM, Yazbek, Daniel (Daniel) wrote: > Hi all, > > > > I am using BEA Weblogic 10, which implements persistence by using kodo > and openjpa. > > I have set this up to persist to a Postgres 8.3 Database. > > I have a java.util.Date that I want as a column in a table. > > When I run the mapping tool, it maps the java.util.Data datatype to > Postgres datatype "abstime". However, this datatype is deprecated, and > should be mapping to "timestamp without time zone" instead. > > Has anyone had any success in mapping this properly? > > Perhaps I should raise a bug against openjpa? > > Thanks > > | Daniel Yazbek | Avaya Labs Australia | 123 Epping Road | North Ryde > 2113 | Australia | +61-2-9352-8615 | dyazbek@avaya.com > |