openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Wolf <>
Subject Re: Cannot get ReverseMappingTool to work
Date Thu, 07 Feb 2013 14:57:46 GMT
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.



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 \
> 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:
> If anyone could help, that would be great.
> Thanks,
>     -Chris

View raw message