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 <cwolf.a...@gmail.com> 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

Reply via email to