Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 5034 invoked from network); 5 Aug 2008 23:46:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Aug 2008 23:46:10 -0000 Received: (qmail 14708 invoked by uid 500); 5 Aug 2008 23:46:09 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 14680 invoked by uid 500); 5 Aug 2008 23:46:09 -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 14669 invoked by uid 99); 5 Aug 2008 23:46:09 -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 16:46:09 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [216.252.110.61] (HELO web55815.mail.re3.yahoo.com) (216.252.110.61) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 Aug 2008 23:45:12 +0000 Received: (qmail 62968 invoked by uid 60001); 5 Aug 2008 23:44:37 -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=x644ZJX7oGc/gm2vZsz+w4a0D5CXsN4Mv/jNC+9K7y8ARzuXDzf3gE/LCDPhC9K56Ashhy4oVU9WI6/6G0CIRal+86pOE3cww7GJpAdJfD9HtdQvJByQWvX2U/bf7palC01TBW8Uvclc6fzxd0Kt23WMHxaWfZ/7EX6e5VCqQYo=; Received: from [32.97.110.142] by web55815.mail.re3.yahoo.com via HTTP; Tue, 05 Aug 2008 16:44:36 PDT X-Mailer: YahooMailWebService/0.7.218 Date: Tue, 5 Aug 2008 16:44:36 -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: <1217978105897-674789.post@n2.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <111276.61826.qm@web55815.mail.re3.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Omitting the "not null" from column definition will make the test case work. However, the insert statement as shown below in the jdbc trace will insert null into the creationts column, and the current timestamp (default by db) will never get inserted into the table. Is this the expected behavior? 6609 CustomerOrder TRACE [main] openjpa.jdbc.SQL - executing prepstmnt 94897576 INSERT INTO EntityA (id, amt, creationts, name) VALUES (?, ?, ?, ?) [params=(int) 1, (double) 0.0, (null) null, (null) null] 6625 CustomerOrder TRACE [main] openjpa.jdbc.SQL - [16 ms] spent 6641 CustomerOrder TRACE [main] openjpa.jdbc.JDBC - [0 ms] commit --- On Tue, 8/5/08, Pinaki Poddar wrote: > From: Pinaki Poddar > Subject: Re: How to apply creation timestamp with > To: users@openjpa.apache.org > Date: Tuesday, August 5, 2008, 4:15 PM > Hi, > Omit 'not null' constraint from the column > definition. > > @Column(name = "creationts", > columnDefinition="timestamp current_timestamp") > > -- > View this message in context: > http://n2.nabble.com/How-to-apply-creation-timestamp-with-tp673210p674789.html > Sent from the OpenJPA Users mailing list archive at > Nabble.com.