Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D65E7EF70 for ; Thu, 7 Feb 2013 14:58:21 +0000 (UTC) Received: (qmail 12607 invoked by uid 500); 7 Feb 2013 14:58:21 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 12169 invoked by uid 500); 7 Feb 2013 14:58:17 -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 12153 invoked by uid 99); 7 Feb 2013 14:58:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 14:58:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cwolf.algo@gmail.com designates 209.85.212.46 as permitted sender) Received: from [209.85.212.46] (HELO mail-vb0-f46.google.com) (209.85.212.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 14:58:10 +0000 Received: by mail-vb0-f46.google.com with SMTP id b13so1675015vby.33 for ; Thu, 07 Feb 2013 06:57:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=rtXh9ylXxy8boDVPTwpZEd+55p6bv2c5yUhOkO50hLY=; b=LBppilZIRgrS/NHF7bM6OHyF6wgEz/JSXVstEC0eG9vHmSKHXbmBon85QC5UKtR/Sk 85kJ/nL59QfAoVvIz8Hsoe9nrXoWipT/Bhtu7y2Tf3n2pz4mETGwsrpbtPeqa2XV83y2 GE6yw/RaGpbEDIKd0danNwMsdVdtIvWRoj9waS1mJnV5xh2kzTeIbaeqC8BYsDWibuG9 XMOng9Dxr+OWrVVf1lZc6fYUxsohxIW/txbwqecBW1GTmSIKjVgNs8RW21H3rwU3mNh+ S5ype9J8VPxVwZmVJLAc+jZFAxiyj1IhBeL4T3jIizXl+fjcOA4nwF4oNB8MbQKWQh63 Obqg== MIME-Version: 1.0 X-Received: by 10.52.177.161 with SMTP id cr1mr1697047vdc.64.1360249066695; Thu, 07 Feb 2013 06:57:46 -0800 (PST) Received: by 10.58.221.8 with HTTP; Thu, 7 Feb 2013 06:57:46 -0800 (PST) In-Reply-To: References: Date: Thu, 7 Feb 2013 09:57:46 -0500 Message-ID: Subject: Re: Cannot get ReverseMappingTool to work From: Chris Wolf To: users@openjpa.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Can anyone say whether the ReverseMappingTool can be configured to work at least as good as EclipseLink's reverse engineering wizard? So far, I have not had much luck with OpenJPA's ReverseMappingTool, while, for the same relatively simple schema, the EclipseLink tool always produces working entities. I was kind of hoping for a command line solution such that it can go into a build script. Regards, Chris On Tue, Feb 5, 2013 at 12:42 PM, Chris Wolf wrote: > For the first few iterations of development, I was using a JPA Eclipse > plugin to generation my entities from their corresponding tables - > this all worked fine, but now I need to implement a reproducible > process for a build script, so I thought it wold be appropriate to > ReverseMappingTool, and it comes close, but not quite close enough to > generating usable entity classes. I only have three tables - master, > detail and link table for many-to-many relationship. > > The JPA Eclipse plugin properly figures out the many-to-many > relationship and generates the appropriate annotations: > > e.g. @ManyToMany(mappedBy="mdBaseData"...) > and @JoinTable(name="..", joinColumns={@JoinColumn(name="id2", > nullable=false)}, inverseJoinColumns={@JoinColumn(name="id1", > nullable=false)}) > > The ReverseMappingTool is not producing these annotations. > > > Here is how I am invoking it: > > java -cp $CP org.apache.openjpa.jdbc.meta.ReverseMappingTool -p > persistence.xml#marketdata \ > -cf.tabSpaces 4 -cf.spaceBeforeParen t -pkg poc.demo.entities \ > -gc t -ann t -sn f -pkj t -ir t -access property -typ > NUMBER=java.math.BigDecimal \ > -d ./../../main/java -cp mapping.properties \ > -schemas POC.MD_BASE_DATA,POC.MD_CURVE_DATA,POC.MD_BASE_DATA_CURVE_DATA > > mapping.properties contains: > > poc.demo.entities.MdCurveData.identity: datastore > poc.demo.entities.MdBaseData.mdCurveData: java.util.Collection > > I am deleting all entities and orm.xml between runs. > > In addition to having ReverseMappingTool create the relationship > annotations, I'd like to know how to tell it to decorate certain date > columns with: > @Temporal( TemporalType.DATE) > > Of course, I already read: > http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/manual.html#ref_guide_pc_reverse > > If anyone could help, that would be great. > > Thanks, > > -Chris