Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 53162 invoked from network); 5 Aug 2008 20:55:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Aug 2008 20:55:37 -0000 Received: (qmail 71077 invoked by uid 500); 5 Aug 2008 20:55:36 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 71041 invoked by uid 500); 5 Aug 2008 20:55:36 -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 71030 invoked by uid 99); 5 Aug 2008 20:55:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2008 13:55:36 -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 [216.252.110.53] (HELO web55807.mail.re3.yahoo.com) (216.252.110.53) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 Aug 2008 20:54:37 +0000 Received: (qmail 92249 invoked by uid 60001); 5 Aug 2008 20:54:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=hLqs4I8WBLr3a0NipNQLyo2kYdVN6GkwF+L5Z4E7EI3Xbz7rTsF+IFefu79LPHxkbG7UtXXmvGyXKgfBuuq3/ZxtCBWZBeZ4Nyo3MsMdXQNWsEgcCcHNHhqvRlsc2Z+8jiOLzAzwF5MtQB3zYttocbIZAQO71mNcZ5CU6egz1eY=; Received: from [32.97.110.142] by web55807.mail.re3.yahoo.com via HTTP; Tue, 05 Aug 2008 13:53:59 PDT X-Mailer: YahooMailWebService/0.7.218 Date: Tue, 5 Aug 2008 13:53:59 -0700 (PDT) From: Fay Wang Reply-To: fyw300@yahoo.com Subject: Re: How to apply creation timestamp with To: users@openjpa.apache.org In-Reply-To: <489819EA.90305@marcelruff.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <334088.91936.qm@web55807.mail.re3.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org I can reproduce this problem against DB2. It looks like that this problem is generic, independent of the backend. The jdbc trace shows: 7828 CustomerOrder TRACE [main] openjpa.jdbc.SQL - executing prepstmnt 1346129980 INSERT INTO EntityA (id, amt, creationts, name) VALUES (?, ?, ?, ?) [params=(int) 1, (double) 0.0, (null) null, (null) null]. Shouldn't Openjpa formulate the insert statement as: INSERT INTO EntityA (id, amt) VALUES(?,?) and exclude the columns from the insert statement where the values are null? -fay --- On Tue, 8/5/08, Marcel Ruff wrote: > From: Marcel Ruff > Subject: How to apply creation timestamp with > To: users@openjpa.apache.org > Date: Tuesday, August 5, 2008, 2:14 AM > Hi, > > i need to set for Postgres 8.3.x on new table entry > creation a timestamp > and have tried this: > > @Column(name = "creationts", > columnDefinition="timestamp not null > default current_timestamp") > public java.sql.Timestamp getCreationTs() { return > creationTs; } > > The dll applied to Postgres directly works fine and creates > the > timestamp during insert on the fly. > > Using openJpa i get: > > org.apache.openjpa.persistence.PersistenceException: > ERROR: null value > in column "creationts" violates not-null > constraint > > what can i do? > > Thanks > Marcel > > -- > Marcel Ruff > http://watchee.net