Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 342 invoked from network); 17 May 2009 17:31:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 May 2009 17:31:06 -0000 Received: (qmail 32348 invoked by uid 500); 17 May 2009 17:31:05 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 32285 invoked by uid 500); 17 May 2009 17:31:05 -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 32275 invoked by uid 99); 17 May 2009 17:31:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 May 2009 17:31:05 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.217.220] (HELO mail-gx0-f220.google.com) (209.85.217.220) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 May 2009 17:30:56 +0000 Received: by gxk20 with SMTP id 20so5679656gxk.9 for ; Sun, 17 May 2009 10:30:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.220.11 with SMTP id s11mr10457502ybg.273.1242581432591; Sun, 17 May 2009 10:30:32 -0700 (PDT) In-Reply-To: <1242566369978-2916124.post@n2.nabble.com> References: <1242566369978-2916124.post@n2.nabble.com> Date: Sun, 17 May 2009 13:30:32 -0400 Message-ID: Subject: Re: id and @GeneratedValue From: Wes Wannemacher To: users@openjpa.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org That is generally a bad idea. Select max(row) will generally initiate a full index scan or, even worse, a full table scan. -Wes On 5/17/09, is_maximum wrote: > > Hello > > Can we tell the OpenJPA to automaticall select maximum id from the table to > set the next id rather than using the OPENJPA_SEQUENCE_TABLE or any other > database object? > > thanks > -- > View this message in context: > http://n2.nabble.com/id-and-%40GeneratedValue-tp2916124p2916124.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > > -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher