Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 34141 invoked from network); 27 Feb 2007 20:33:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Feb 2007 20:33:27 -0000 Received: (qmail 68883 invoked by uid 500); 27 Feb 2007 20:33:35 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 68855 invoked by uid 500); 27 Feb 2007 20:33:35 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 68846 invoked by uid 99); 27 Feb 2007 20:33:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Feb 2007 12:33:35 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Feb 2007 12:33:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8300F714044 for ; Tue, 27 Feb 2007 12:33:05 -0800 (PST) Message-ID: <33107105.1172608385518.JavaMail.jira@brutus> Date: Tue, 27 Feb 2007 12:33:05 -0800 (PST) From: "Sherry Shen (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Commented: (OPENJPA-94) Allow MappingTool and persistence.xml to support drop-create for database schema In-Reply-To: <8812029.1167773307829.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476367 ] Sherry Shen commented on OPENJPA-94: ------------------------------------ This one works. However, it doesn't work if deleteTableContents is replaced with delete-table-contents. I observed the error, Exception in thread "main" <0|false|0.9.7-incubating-SNAPSHOT> org.apache.openjpa.persistence.PersistenceException: action == delete-table-contents at org.apache.openjpa.kernel.AbstractBrokerFactory. newBroker(AbstractBrokerFactory.java:190) at org.apache.openjpa.kernel.DelegatingBrokerFactory. newBroker(DelegatingBrokerFactory.java:139) at org.apache.openjpa.persistence.EntityManagerFactoryImpl. createEntityManager(EntityManagerFactoryImpl.java:187) at org.apache.openjpa.persistence.EntityManagerFactoryImpl. createEntityManager(EntityManagerFactoryImpl.java:140) at org.apache.openjpa.persistence.EntityManagerFactoryImpl. createEntityManager(EntityManagerFactoryImpl.java:52) at TestClient.main(TestClient.java:13) Caused by: java.lang.IllegalArgumentException: action == delete-table-contents I also tried the other suggestion. The test with \\\" has SAXParseException similar to the test with \". You may use my test in the attachemnt of this issue to try which one works. It is better to document the usage with examples. > Allow MappingTool and persistence.xml to support drop-create for database schema > -------------------------------------------------------------------------------- > > Key: OPENJPA-94 > URL: https://issues.apache.org/jira/browse/OPENJPA-94 > Project: OpenJPA > Issue Type: New Feature > Reporter: Shay Banon > Attachments: openjpa_94.zip > > > Currently, in the persistence context, one can define: > > Which causes OpenJPA to build the database schema based on the mapping defined. Currently, there is no way to define it to drop tables if they exists before creating the database schema. This is very useful for tests that drop (if exists) and creates new tables for each test. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.