From dev-return-6004-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Aug 30 06:24:32 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 97944 invoked from network); 30 Aug 2007 06:24:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Aug 2007 06:24:32 -0000 Received: (qmail 50520 invoked by uid 500); 30 Aug 2007 06:24:27 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 50483 invoked by uid 500); 30 Aug 2007 06:24:27 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 50474 invoked by uid 99); 30 Aug 2007 06:24:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 23:24:27 -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: domain of plinskey@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Aug 2007 06:24:23 +0000 Received: by py-out-1112.google.com with SMTP id f47so768165pye for ; Wed, 29 Aug 2007 23:24:03 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oYCWd+awnvp4IT7yFAFbty/vEyJXcQ8E6hWfNh4FtHA+AcLzgFPzOfokcNX7ylYTQJ7kyCS5kWJwD1PVcmu3SGRPCnWLS470RuRmf1Dvbs4cs4f2YK6OJOs1lyG3m1Y0pUix4VZPD1kN45DiW6vuey2BCG3FQjTzQuRhrMqmDWA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eUqGUvqVWjVxoDCF1X0Gcjf5Ln4+hn/RpfOy6tmJP7IckyWiYJTkWuuoXMKrMptWKsBX4dA5E7EBDiGDuArHBhBmsVvtG+rNOCikIDmfUZcqWp/E1OemNpQP2gCHl+ZzBNr+7+cdLRG7KIEzrWO9j4Iuuf10zEi10xfHLRmBxzw= Received: by 10.35.68.3 with SMTP id v3mr253364pyk.1188455042846; Wed, 29 Aug 2007 23:24:02 -0700 (PDT) Received: by 10.35.100.9 with HTTP; Wed, 29 Aug 2007 23:24:02 -0700 (PDT) Message-ID: <7262f25e0708292324o788efe0fv79bc939ed0c49488@mail.gmail.com> Date: Wed, 29 Aug 2007 23:24:02 -0700 From: "Patrick Linskey" To: dev@openjpa.apache.org Subject: Re: Question:openJpa.How can I automatic generate table using openjpa? In-Reply-To: <30466be10708292310o7d9fee6n3d561d608f6d4b15@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <30466be10708292310o7d9fee6n3d561d608f6d4b15@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, You can do something similar like so in OpenJPA: Personally, for unit testing, I prefer the following: That will update the schema with any new elements, and will issue unqualified delete statements against all the tables that OpenJPA knows about. For tables with a small number of records in them, this is usually the fastest way to get a clean schema. -Patrick On 8/29/07, Keqiang Feng wrote: > When I use toplink,I put " value="create-tables"/>" into persistence.xml.Then i don't need create table > in database by my hand.I just write a java bean and r/w it from > database.Ifit's not existed of the table,toplink will create it. > > I can't find it in openjpa.If you have this function,please tell me.I think > it's very useful function. > > Thank you! > -- Patrick Linskey 202 669 5907